-
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 the behavior when adding date with big interval | tidb-test=pr/2260 #49228
Conversation
069050c
to
0fb94fd
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49228 +/- ##
================================================
+ Coverage 71.0591% 71.8128% +0.7536%
================================================
Files 1368 1412 +44
Lines 401982 415363 +13381
================================================
+ Hits 285645 298284 +12639
- Misses 96472 98243 +1771
+ Partials 19865 18836 -1029
Flags with carried forward coverage won't be shown. Click here to find out more.
|
19e6df0
to
5bb3022
Compare
/retest |
/retest |
5bb3022
to
2df7652
Compare
@@ -2754,7 +2754,7 @@ type baseDateArithmetical struct { | |||
|
|||
func newDateArithmeticalUtil() baseDateArithmetical { | |||
return baseDateArithmetical{ | |||
intervalRegexp: regexp.MustCompile(`-?[\d]+`), | |||
intervalRegexp: regexp.MustCompile(`^[+-]?[\d]+`), |
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.
XXX1
should be parsed as "", not "1"
209f67b
to
d33c99a
Compare
fa2a92f
to
e09eeb0
Compare
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.
Rest LGTM
e09eeb0
to
7e338f3
Compare
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
7e338f3
to
8a6bb2c
Compare
/retest |
1 similar comment
/retest |
0b130b9
to
1066ef0
Compare
/retest |
/retest |
1 similar comment
/retest |
09f2727
to
56ff39f
Compare
/retest |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: windtalker, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: close #49227
What changed and how does it work?
date + interval X uint
when X is a big value, we should getNULL
date + interval "true" DAY
should not add one day, onlydate + interval true DAY
should be seen as add 1 time unit.date + interval "xxx1" uint
, if an interval string does not start with +/- or a digit, it should be truncated as 0, not 1.SECOND
is special, it should accept string in in exponential format, for example:select "1900-01-01 00:00:00" + INTERVAL "1e2" second;
should add 100 seconds.SECOND
, the interval string should be regarded as float, other units should be regarded as int.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.