Skip to content
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

types: fix parse date inconsistent with MySQL (#14405) #16242

Merged
merged 4 commits into from
Apr 10, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 9, 2020

cherry-pick #14405 to release-3.0


Signed-off-by: Lonng heng@lonng.org

What problem does this PR solve?

The parse string to date inconsistent with MySQL:

mysql> select convert('1201012736.0000', date);
+----------------------------------+
| convert('1201012736.0000', date) |
+----------------------------------+
| NULL                             |
+----------------------------------+
1 row in set, 1 warning (0.01 sec)

mysql> select convert('1201012136.0000', date);
+----------------------------------+
| convert('1201012136.0000', date) |
+----------------------------------+
| 2012-01-01                       |
+----------------------------------+
1 row in set, 1 warning (0.00 sec)

The MySQL will check the hms even if the target type is Date.
Mirror PR: tikv/tikv#6442

What is changed and how it works?

Check Date via checkDatetimeType

Check List

Tests

  • Unit test

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 9, 2020

/run-all-tests

@reafans
Copy link
Contributor

reafans commented Apr 9, 2020

/run-unit-test

1 similar comment
@reafans
Copy link
Contributor

reafans commented Apr 9, 2020

/run-unit-test

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djshow832
Copy link
Contributor

Will it break compatibility?

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@reafans
Copy link
Contributor

reafans commented Apr 9, 2020

Will it break compatibility?

Don't worry, it's ok.

@reafans
Copy link
Contributor

reafans commented Apr 9, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 9, 2020

Sorry @reafans, you don't have permission to trigger auto merge event on this branch.

@bb7133
Copy link
Member

bb7133 commented Apr 10, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 10, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 10, 2020

/run-all-tests

@sre-bot sre-bot merged commit f0e6e64 into pingcap:release-3.0 Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug. type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants