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

Merged
merged 1 commit into from
Jan 9, 2020
Merged

types: fix parse date inconsistent with MySQL #14405

merged 1 commit into from
Jan 9, 2020

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Jan 9, 2020

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: Lonng <heng@lonng.org>
@lonng lonng added type/bugfix This PR fixes a bug. needs-cherry-pick-3.0 labels Jan 9, 2020
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@lonng
Copy link
Contributor Author

lonng commented Jan 9, 2020

/run-all-tests

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

@lonng lonng merged commit 667f2d7 into pingcap:master Jan 9, 2020
@lonng lonng deleted the fix-invalid-time branch January 9, 2020 03:49
@sre-bot
Copy link
Contributor

sre-bot commented Jan 9, 2020

cherry pick to release-3.0 failed

@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

It seems that, not for sure, we failed to cherry-pick this commit to release-3.0. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @lonng PTAL.

@reafans
Copy link
Contributor

reafans commented Apr 9, 2020

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Apr 9, 2020

cherry pick to release-3.0 in PR #16242

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Apr 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants