-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MySQL Compatibility 1/4][Bug] Fix bug that set sql_mode with concat() function failed #4359
Conversation
try { | ||
VariableMgr.fillValue(ConnectContext.get().getSessionVariable(), (SysVariableDesc) constExpr); | ||
return ((SysVariableDesc) constExpr).getLiteralExpr(); | ||
} catch (AnalysisException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just throw the exception to the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
…and MySQL (#7108) Introduce by pr #4359 VariableMgr.fillValue() method should not call in ExpressionFunctions.eval(), because in method analyzeImpl() of SysVariableDesc, it has been already called once. If VariableMgr.fillValue() was called twice, the type of SysVariableDesc will become BigInt, which is incorrect.
BUT still failed for this (when I use SAP DataService to connect Doris ):
the client side auto execute this when connect |
Proposed changes
Support
set sql_mode = concat(@@sql_mode, "STRICT_TRANS_TABLES");
Types of changes
Checklist