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/14 11:47:53 UTC

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

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