-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expression: fix builtin IF truncation of type len #20743
Conversation
/run-all-tests |
/run-unit-test |
1 similar comment
/run-unit-test |
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.
LGTM
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.
LGTM
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@nullnotnil merge failed. |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
/run-all-tests |
@nullnotnil merge failed. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21144 |
What problem does this PR solve?
Issue Number: Fixes #20730
Problem Summary:
When one of the values of the built-in function
if
is an expression, the type length is calculated incorrectly. This leads to values being truncated in user variables, which could lead to wrong results.What is changed and how it works?
What's Changed:
If the length is unknown (-1) the length of mysql.MaxRealWidth is returned instead. This is the behavior observed in MySQL.
Related changes
Check List
Tests
Side effects
Release note
IF
function and user variables could lead to wrong results.