-
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: handle tp.flen overflow in to_base64 function (#20947) #21813
expression: handle tp.flen overflow in to_base64 function (#20947) #21813
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
/run-all-tests |
@nullnotnil you're already a collaborator in bot's repo. |
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
@wshwsh12, @SunRunAway, @XuHuaiyu, @wjhuang2016, @lzmhhh123, PTAL. |
2 similar comments
@wshwsh12, @SunRunAway, @XuHuaiyu, @wjhuang2016, @lzmhhh123, PTAL. |
@wshwsh12, @SunRunAway, @XuHuaiyu, @wjhuang2016, @lzmhhh123, PTAL. |
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
@wshwsh12, @lzmhhh123, @SunRunAway, @XuHuaiyu, @wjhuang2016, PTAL. |
@wshwsh12, @lzmhhh123, @SunRunAway, @XuHuaiyu, @wjhuang2016, PTAL. |
1 similar comment
@wshwsh12, @lzmhhh123, @SunRunAway, @XuHuaiyu, @wjhuang2016, PTAL. |
/merge |
cherry-pick #20947 to release-4.0
What problem does this PR solve?
Issue Number: Fixes #14349
Problem Summary:
The builtin function
to_base64
previously returned NULL when the tp.flen exceeded the maxbloblen. But it's possible that the length could exceed this very easily by using a type such aslongtext
, even though based on TiDB's current limits it wouldn't be possible to construct a row-size this length.What is changed and how it works?
What's Changed:
This changes the behavior of
to_base64
to be similar to other built-ins, where overflow is handled by setting thetp.Flen
to themysql.MaxBlobWidth
.Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note
to_base64
always returnedNULL
. It now returns the correct value.