-
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: handle invalid argument for addtime and subtime function #21600
Conversation
arg0, err := types.ParseTime(sc, d, mysql.TypeDatetime, types.MaxFsp) | ||
if err != nil { | ||
return "", err | ||
sc.AppendWarning(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.
Why don't we check the sql_mode to decide whether to return an error or a warning?
e.g. sc.HandleTruncate
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.
Even in the strict mode, MySQL returns a warning.
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.
Add a comment for it?
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
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
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
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@wjhuang2016 merge failed. |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@wjhuang2016 merge failed. |
/run-check_dev_2 |
/run-integration-copr-test |
450e719
to
fddf6cc
Compare
/run-integration-copr-test |
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
LGTM |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21635 |
Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com
What problem does this PR solve?
Issue Number: close #12342
Problem Summary:
Didn't handle the error for the second argument.
What is changed and how it works?
If the second argument is invalid, use
NULL
instead of returning an error.Related changes
Check List
Tests
Side effects
Release note