-
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
util: fix bad number error with DISTINCT when dividing long decimals #21783
Conversation
/run-all-tests |
LGTM |
util/codec/codec.go
Outdated
if frac > mysql.MaxDecimalScale { | ||
frac = mysql.MaxDecimalScale | ||
} |
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.
Should we add this to EncodeDecimal
rather than here? Because EncodeDecimal
is also called elsewhere, this problem may also occur here?
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.
Yes, I think so and I have moved the logic to EncodeDecimal
.
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 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #24188 |
What problem does this PR solve?
Issue Number: close #15563
Problem Summary:
What is changed and how it works?
What's Changed:
fix bad number error with DISTINCT when dividing long decimals
How it Works:
set precision and frac before calling
EncodeDecimal
Related changes
Check List
Tests
Side effects
Release note