-
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
fix ConvertJSONToInt unsigned bug #11483
Conversation
Signed-off-by: H-ZeX <hzx20112012@gmail.com>
/test |
/run-all-tests |
expression/integration_test.go
Outdated
@@ -2180,6 +2180,7 @@ func (s *testIntegrationSuite) TestBuiltin(c *C) { | |||
result.Check(testkit.Rows("2017-01-01 00:00:00.00")) | |||
result = tk.MustQuery(`select cast(20170118.999 as datetime);`) | |||
result.Check(testkit.Rows("2017-01-18 00:00:00")) | |||
tk.MustExec(`select convert(a2.a, unsigned int) from (select cast('"9223372036854775808"' as json) as a) as a2;`) |
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.
s/MustExec/MustQuery/
Otherwise, you will find you can pass this test in master too.
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.
s/MustExec/MustQuery/
Otherwise, you will find you can pass this test in master too.
What's difference between this two MustXXX operations?
Codecov Report
@@ Coverage Diff @@
## master #11483 +/- ##
===========================================
Coverage 81.3173% 81.3173%
===========================================
Files 425 425
Lines 91668 91668
===========================================
Hits 74542 74542
Misses 11771 11771
Partials 5355 5355 |
Signed-off-by: H-ZeX <hzx20112012@gmail.com>
…o fix-StrToInt-unsigned-bug
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 |
cherry pick to release-2.1 failed |
cherry pick to release-3.0 in PR #11551 |
Signed-off-by: H-ZeX <hzx20112012@gmail.com>
Signed-off-by: H-ZeX hzx20112012@gmail.com
What problem does this PR solve?
The origin
ConvertJSONToInt
will fail in this sqlselect convert(a2.a, unsigned int) from (select cast('"9223372036854775808"' as json) as a) as a2;
What is changed and how it works?
call
StrToInt
orStrToUint
according to the paramunsigned
.Check List
Tests
Code changes
No
Side effects
No.
Related changes
No.