Closed qw4990 closed 3 years ago
[REVIEW NOTIFICATION]
This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer
in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer
in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
/merge
This pull request has been accepted and is ready to merge.
What problem does this PR solve?
To fix https://github.com/pingcap/tidb/issues/27544. Now when restoring an expression, the parser doesn't add brackets for binary operations, which may change the meaning of the expression after restoring. For example,
mod( year(a) - abs(weekday(a) + dayofweek(a)), 4) + 1
will be restored toYEAR(a)-ABS(WEEKDAY(a)+DAYOFWEEK(a))%4+1
.What is changed and how it works?
Introduce a new restore flag RestoreBracketAroundBinaryOperation to control this behavior.
Check List
Tests