-
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 the issue that incorrect result for a predicate that uses the CHAR() function #16014
Conversation
iVal, err = HandleOverflowOnSelection(sc, iVal, err) | ||
if err != nil { | ||
return err | ||
} |
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.
The function types.StrToFloat
does not generate an overflow
error, so the function HandleOverflowOnSelection
and the test TestVecToBool
are both unneeded.
Codecov Report
@@ Coverage Diff @@
## master #16014 +/- ##
===========================================
Coverage ? 80.3714%
===========================================
Files ? 506
Lines ? 136317
Branches ? 0
===========================================
Hits ? 109560
Misses ? 18215
Partials ? 8542 |
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
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.
From #15986,
Interestingly, the first query results in the following warning:
mysql> show warnings;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '.9<' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
Please add some test cases to ensure there's no this type of warnings anymore.
The warning seems can not be eliminated. Because in the implementation of TIDB, when the string type cannot be completely converted to the float type, it will prompt this warning. @SunRunAway 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
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
/run-all-tests |
@Reminiscent merge failed. |
/merge |
/run-all-tests |
@Reminiscent merge failed. |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-2.1 in PR #16556 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-3.0 in PR #16557 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-3.1 in PR #16558 |
cherry pick to release-4.0 in PR #16559 |
What problem does this PR solve?
Issue Number: close #15986
What is changed and how it works?
When we use the
string
type to determine thebool
value, thestring
type is converted to afloat
type instead of anint
type.Check List
Tests