-
Notifications
You must be signed in to change notification settings - Fork 409
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
Fix cast to decimal overflow bug #3922
Conversation
Signed-off-by: guo-shaoge <shaoge1994@163.com>
[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. |
Signed-off-by: guo-shaoge <shaoge1994@163.com>
…to fix_cast_overflow_bug Signed-off-by: guo-shaoge <shaoge1994@163.com> Conflicts: dbms/src/Functions/tests/gtest_tidb_conversion.cpp
Signed-off-by: guo-shaoge <shaoge1994@163.com>
/run-all-tests |
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1102/cobertura/ lines: 44.7% (51537 out of 115273) |
Signed-off-by: guo-shaoge <shaoge1994@163.com>
/run-all-tests |
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1120/cobertura/ lines: 44.7% (51544 out of 115280) |
{ | ||
context.getDAGContext()->handleOverflowError("cast to decimal", Errors::Types::Truncated); | ||
if (value > 0) | ||
return static_cast<UType>(max_value); | ||
if (outer_value > 0) |
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.
if (outer_value > 0) | |
if (outer_value >= 0) |
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 scaled_max_value
cannot be zero, so this equal doesn't matter.
Signed-off-by: guo-shaoge <shaoge1994@163.com>
4aab693
to
1a06c96
Compare
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1184/cobertura/ lines: 44.7% (51712 out of 115579) |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #3942. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4073. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4081. |
In response to a cherrypick label: new pull request created: #4082. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4083. |
lines: 44.3% (51706 out of 116690) |
What problem does this PR solve?
Issue Number: close #3920
Problem Summary: todo
What is changed and how it works?
inner_value
withinner_max_value
orout_value
withouter_max_value
. I choose inner_value here.Check List
Tests
Side effects
Documentation
Release note