You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/04/09 06:29:20 UTC

[GitHub] [incubator-doris] Userwhite opened a new pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Userwhite opened a new pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620


   ## Proposed changes
   
   1. record the modified session value's initial value.
   2. when the sql's execute has finished,set session value to initial value.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [x] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [x] I have created an issue on (Fix #5570 ) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [x] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Userwhite commented on pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
Userwhite commented on pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#issuecomment-816458663


   > ## Proposed changes
   > 1. record the modified session value's initial value.
   > 2. when the sql's execute has finished,set session value to initial value.
   > 
   > ## Types of changes
   > What types of changes does your code introduce to Doris?
   > _Put an `x` in the boxes that apply_
   > 
   > * [x]  Bugfix (non-breaking change which fixes an issue)
   > * [ ]  New feature (non-breaking change which adds functionality)
   > * [ ]  Breaking change (fix or feature that would cause existing functionality to not work as expected)
   > * [ ]  Documentation Update (if none of the other choices apply)
   > * [ ]  Code refactor (Modify the code structure, format the code, etc...)
   > 
   > ## Checklist
   > _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   > 
   > * [x]  I have created an issue on (Fix #5570 ) and described the bug/feature there in detail
   > * [ ]  Compiling and unit tests pass locally with my changes
   > * [x]  I have added tests that prove my fix is effective or that my feature works
   > * [ ]  If these changes need document changes, I have updated the document
   > * [ ]  Any dependent changes have been merged
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#discussion_r616444977



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
##########
@@ -124,6 +124,12 @@
     public static final long DEFAULT_INSERT_VISIBLE_TIMEOUT_MS = 10_000;
     public static final long MIN_INSERT_VISIBLE_TIMEOUT_MS = 1000; // If user set a very small value, use this value instead.
 
+    // session origin value
+    public static final Map<Field, String> sessionOriginValue = new HashMap<Field, String>();

Review comment:
       Why using `static`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#discussion_r613170837



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
##########
@@ -253,7 +253,10 @@ public void execute() throws Exception {
     // Exception:
     //  IOException: talk with client failed.
     public void execute(TUniqueId queryId) throws Exception {
-
+        // origin value init
+        VariableMgr.setIsSingleSetVar(false);
+        VariableMgr.clearMapSessionOriginValue();

Review comment:
       VariableMgr is not a thread safe class.
   But `execute()` can be called by multi threads




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#discussion_r613087692



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
##########
@@ -102,6 +103,11 @@
     public static final int READ_ONLY = 8;
     // Variables with this flag can not be seen with `SHOW VARIABLES` statement.
     public static final int INVISIBLE = 16;
+    // session origin value
+    private static final Map<Field,String> sessionOriginValue;

Review comment:
       ```suggestion
       private static final Map<Field, String> sessionOriginValue;
   ```

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
##########
@@ -253,7 +253,10 @@ public void execute() throws Exception {
     // Exception:
     //  IOException: talk with client failed.
     public void execute(TUniqueId queryId) throws Exception {
-
+        // origin value init
+        VariableMgr.setIsSingleSetVar(false);
+        VariableMgr.clearMapSessionOriginValue();

Review comment:
       So  `isSingleSetVar` and `sessionOriginValue` should be set in `SessionVariables` instance.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
##########
@@ -118,6 +124,7 @@
 
     // Form map from variable name to its field in Java class.
     static {
+        sessionOriginValue = new HashMap<Field,String>();

Review comment:
       ```suggestion
           sessionOriginValue = new HashMap<Field, String>();
   ```

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
##########
@@ -253,7 +253,10 @@ public void execute() throws Exception {
     // Exception:
     //  IOException: talk with client failed.
     public void execute(TUniqueId queryId) throws Exception {
-
+        // origin value init
+        VariableMgr.setIsSingleSetVar(false);
+        VariableMgr.clearMapSessionOriginValue();

Review comment:
       VariableMgr is a thread safe class.
   But `execute()` can be called by multi threads




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Userwhite removed a comment on pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
Userwhite removed a comment on pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#issuecomment-816458663


   > ## Proposed changes
   > 1. record the modified session value's initial value.
   > 2. when the sql's execute has finished,set session value to initial value.
   > 
   > ## Types of changes
   > What types of changes does your code introduce to Doris?
   > _Put an `x` in the boxes that apply_
   > 
   > * [x]  Bugfix (non-breaking change which fixes an issue)
   > * [ ]  New feature (non-breaking change which adds functionality)
   > * [ ]  Breaking change (fix or feature that would cause existing functionality to not work as expected)
   > * [ ]  Documentation Update (if none of the other choices apply)
   > * [ ]  Code refactor (Modify the code structure, format the code, etc...)
   > 
   > ## Checklist
   > _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   > 
   > * [x]  I have created an issue on (Fix #5570 ) and described the bug/feature there in detail
   > * [ ]  Compiling and unit tests pass locally with my changes
   > * [x]  I have added tests that prove my fix is effective or that my feature works
   > * [ ]  If these changes need document changes, I have updated the document
   > * [ ]  Any dependent changes have been merged
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Userwhite commented on a change in pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
Userwhite commented on a change in pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#discussion_r621095354



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
##########
@@ -124,6 +124,12 @@
     public static final long DEFAULT_INSERT_VISIBLE_TIMEOUT_MS = 10_000;
     public static final long MIN_INSERT_VISIBLE_TIMEOUT_MS = 1000; // If user set a very small value, use this value instead.
 
+    // session origin value
+    public static final Map<Field, String> sessionOriginValue = new HashMap<Field, String>();

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Userwhite closed pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
Userwhite closed pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Userwhite commented on a change in pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
Userwhite commented on a change in pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620#discussion_r614630662



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
##########
@@ -253,7 +253,10 @@ public void execute() throws Exception {
     // Exception:
     //  IOException: talk with client failed.
     public void execute(TUniqueId queryId) throws Exception {
-
+        // origin value init
+        VariableMgr.setIsSingleSetVar(false);
+        VariableMgr.clearMapSessionOriginValue();

Review comment:
       Got it and Fixed. sorry for my fault.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg merged pull request #5620: [Bug] The operator on single Sql has affected the session varaiables

Posted by GitBox <gi...@apache.org>.
yangzhg merged pull request #5620:
URL: https://github.com/apache/incubator-doris/pull/5620


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org