-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 wrong flen infer for bit constant #23867
Conversation
Signed-off-by: lzmhhh123 <[email protected]>
@@ -250,7 +250,7 @@ func DefaultTypeForValue(value interface{}, tp *FieldType, char string, collate | |||
SetBinChsClnFlag(tp) | |||
case BitLiteral: | |||
tp.Tp = mysql.TypeVarString | |||
tp.Flen = len(x) | |||
tp.Flen = len(x) * 3 |
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 make this change?
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.
Because the max bit value for a byte is 127
which flen is 3
[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 writing |
/merge |
/run-all-tests This bot automatically retries jobs that failed on can merge PRs (send feedback to hi-rustin). Silence the bot with the |
/merge cancel for consistent failures. @lzmhhh123 Could you please take a look? |
/run-all-tests |
/run-all-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: a54dd3b
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #24266 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #24267 |
Signed-off-by: lzmhhh123 [email protected]
What problem does this PR solve?
Issue Number: close #23479
What is changed and how it works?
How it Works:
Related changes
Check List
Tests
Release note