-
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
expression: fix cast(-num as datetime)
to return null instead of error
#10368
Conversation
{0, types.NewIntDatum(0), types.KindInt64, "0"}, | ||
{0, types.NewIntDatum(-1), types.KindInt64, "0"}, | ||
{0, types.NewIntDatum(12345), types.KindInt64, "0"}, | ||
//{0, types.NewIntDatum(0), types.KindInt64, "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.
This is another bug(#10361) and I will fix it by another PR.
result.Check(testkit.Rows("0")) | ||
result = tk.MustQuery("SELECT UNIX_TIMESTAMP(12345);") | ||
result.Check(testkit.Rows("0")) | ||
//result = tk.MustQuery("SELECT UNIX_TIMESTAMP(-1);") |
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.
This is another bug(#10361) and I will fix it by another PR.
Codecov Report
@@ Coverage Diff @@
## master #10368 +/- ##
================================================
- Coverage 77.3669% 77.3454% -0.0215%
================================================
Files 412 412
Lines 85702 85687 -15
================================================
- Hits 66305 66275 -30
- Misses 14363 14383 +20
+ Partials 5034 5029 -5 |
/run-all-tests |
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
cast
is not compatible with MySQLcast(-num as datetime)
to return null instead of error
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 |
/run-all-tests |
What problem does this PR solve?
Fix #9769
What is changed and how it works?
Call
handleInvalidTimeError
to handle errors.Check List
Tests