-
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: compatibility is changed #30653
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
/run-check_title |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
/run-check_title |
/run-check_dev |
/run-unit-test |
when I pull the code, there are 4 test in expression cannot pass |
/cc @gregwebs Could you help look at it, I do not know why I cannot pass unit_test, and I pull the code without my PR then do |
/cc @foobar Could someone look at it? emmmm.... |
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.
[2021-12-12T13:04:46.677Z] --- FAIL: TestTimeBuiltin (0.51s)
[2021-12-12T13:04:46.677Z] result.go:50:
[2021-12-12T13:04:46.677Z] Error Trace: result.go:50
integration_serial_test.go:2170
[2021-12-12T13:04:46.677Z] Error: Not equal:
[2021-12-12T13:04:46.677Z] expected: "[2017-01-01 01:01:06 2017-01-01 01:00:56 2017-01-01 01:01:01 2017-01-01 01:01:02.340000]\n"
[2021-12-12T13:04:46.677Z] actual : "[2017-01-01 01:01:06 <nil> 2017-01-01 01:01:01 2017-01-01 01:01:02.340000]\n"
How about the case like the test in this TestTimeBuiltin
.
mysql> select addtime('2017-01-01 01:01:01', -5);
+------------------------------------+
| addtime('2017-01-01 01:01:01', -5) |
+------------------------------------+
| 2017-01-01 01:00:56 |
+------------------------------------+
1 row in set (0.01 sec)
/run-check_dev_2 |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/4631a1c23ab65c45a9b02e291786597be410027b |
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 seems to fix the issue described.
Note that there are still some other corner cases:
MySQL 8.0.27:
mysql> select ADDTIME('2020-05-13 14:01:24', '-10000000');
+---------------------------------------------+
| ADDTIME('2020-05-13 14:01:24', '-10000000') |
+---------------------------------------------+
| 2020-04-08 15:01:25 |
+---------------------------------------------+
1 row in set, 1 warning (0.00 sec)
Warning (Code 1292): Truncated incorrect time value: '-10000000'
TiDB:
sql> select ADDTIME('2020-05-13 14:01:24', '-10000000');
+---------------------------------------------+
| ADDTIME('2020-05-13 14:01:24', '-10000000') |
+---------------------------------------------+
| NULL |
+---------------------------------------------+
1 row in set, 1 warning (0.0007 sec)
Warning (code 1292): Truncated incorrect time value: '-10000000'
@@ -5556,6 +5557,16 @@ func (b *builtinAddStringAndStringSig) evalString(row chunk.Row) (result string, | |||
} | |||
return "", true, err | |||
} | |||
|
|||
check := arg1Str |
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.
I think it would be useful to add a comment here about why this is needed
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.
Yeah, In fact I think add the code in func isDuration
or create a new func maybeErrDuration
may be butter, but isDuration
is a util func, I'm afraid to get new wrong, so I add the code here. I may add some cmment or create a new func, but which file may i add the func?
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.
I will check the other concor case and try to solve them
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 |
This pull request has been accepted and is ready to merge. Commit hash: 585d649
|
@Tangruilin: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #19150
Problem Summary:
What is changed and how it works?
After
ParseDuration
inbuiltinAddStringAndStringSig.evalString
, format like*-*
will be checked,if the arg1Strmatch this format, it will return isNullCheck List
Tests
Side effects
Documentation
Release note