-
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
*: add_date can return mysql.Time #9830
Conversation
The overflow checking is not finished. And i think the previous add_date will cause overflow too... |
@@ -30,11 +29,6 @@ import ( | |||
"github.com/pingcap/tidb/util/testleak" | |||
) | |||
|
|||
func TestT(t *testing.T) { |
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.
It's a redundant one.
Codecov Report
@@ Coverage Diff @@
## master #9830 +/- ##
================================================
- Coverage 77.1152% 77.0556% -0.0597%
================================================
Files 412 412
Lines 86337 86457 +120
================================================
+ Hits 66579 66620 +41
- Misses 14672 14730 +58
- Partials 5086 5107 +21 |
return ZeroDuration, err | ||
} | ||
// MONTH must exceed the limit of mysql's duration. So just return overflow error. | ||
return ZeroDuration, ErrDatetimeFunctionOverflow.GenWithStackByArgs("time") |
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.
So why not ignore line 1902~1905 ?
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.
Oh, my concern is that though it must exceed the limit, should we raise the overflow error when the content cannot be formatted in fact?
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.
is it controlled by a certain sql mode?
@winoros Please update this pr branch with the latest master |
Wait for #10329 merged first. |
/run-all-tests |
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
What problem does this PR solve?
to #9813
What is changed and how it works?
Implement things according to MySQL source code.
Check List
Tests
Side effects
Related changes