-
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: resize the result for IfXXSig #37417
Conversation
[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 The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
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.
Will other expressions like case when
have the same issue?
I am not able to reproduce the issue with insert into foo select case when b>0 then
case when a/b>1 then 1 else a/b end
else null end
from bar; I am not sure whether it doesn't have the issue or it just can't expose the issue. |
tk.MustExec("create table foo(a decimal(65,0));") | ||
tk.MustExec("create table bar(a decimal(65,0), b decimal(65,0));") | ||
tk.MustExec("insert into bar values(0,0),(1,1),(2,2);") | ||
tk.MustExec("insert into foo select if(b>0, if(a/b>1, 1, 2), null) from bar;") |
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.
How about adding ifNULL
and CaseWhen
cases?
tidb/expression/generator/control_vec.go Lines 64 to 69 in a8f524b
|
tidb/expression/generator/control_vec.go Lines 268 to 277 in 7425d2f
|
/merge |
This pull request has been accepted and is ready to merge. Commit hash: af1047f
|
cherry pick to release-5.0 in PR #37425 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.1 in PR #37426 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.2 in PR #37427 |
cherry pick to release-5.3 in PR #37428 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.4 in PR #37429 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-6.0 in PR #37430 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-6.1 in PR #37431 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-6.2 in PR #37432 |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #37414
Problem Summary:
The
IfXXSig.fallbackEvalXX
forgets to resize theresult
, thus trigger the index out of range error.What is changed and how it works?
Check List
Tests
Side effects
N/A
Documentation
N/A
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.