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 2020/08/16 10:56:18 UTC

[GitHub] [incubator-doris] morningman opened a new pull request #4359: [Bug] Fix bug that set sql_mode with concat() function failed

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


   ## Proposed changes
   
   Support `set sql_mode = concat(@@sql_mode, "STRICT_TRANS_TABLES");`
   
   ## Types of changes
   
   - [x] Bugfix (non-breaking change which fixes an issue)
   
   ## Checklist
   
   - [] I have create an issue on (Fix #4358), and have described the bug/feature there in detail
   - [] Compiling and unit tests pass locally with my changes


----------------------------------------------------------------
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] EmmyMiao87 commented on a change in pull request #4359: [MySQL Compatibility 1/4][Bug] Fix bug that set sql_mode with concat() function failed

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



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java
##########
@@ -96,6 +98,14 @@ public Expr evalExpr(Expr constExpr) {
                     return constExpr;
                 }
             }
+        } else if (constExpr instanceof SysVariableDesc) {
+            try {
+                VariableMgr.fillValue(ConnectContext.get().getSessionVariable(), (SysVariableDesc) constExpr);
+                return ((SysVariableDesc) constExpr).getLiteralExpr();
+            } catch (AnalysisException e) {

Review comment:
       Why not just throw the exception to the user?




----------------------------------------------------------------
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 #4359: [MySQL Compatibility 1/4][Bug] Fix bug that set sql_mode with concat() function failed

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



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java
##########
@@ -96,6 +98,14 @@ public Expr evalExpr(Expr constExpr) {
                     return constExpr;
                 }
             }
+        } else if (constExpr instanceof SysVariableDesc) {
+            try {
+                VariableMgr.fillValue(ConnectContext.get().getSessionVariable(), (SysVariableDesc) constExpr);
+                return ((SysVariableDesc) constExpr).getLiteralExpr();
+            } catch (AnalysisException e) {

Review comment:
       This method is used for constant folding rules. If it fails, it will directly return to the original expression, and other processes will handle this error.




----------------------------------------------------------------
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 merged pull request #4359: [MySQL Compatibility 1/4][Bug] Fix bug that set sql_mode with concat() function failed

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


   


----------------------------------------------------------------
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