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 DATETIME/TIME from string incompatible with MySQL (#14547) #14570

Merged
merged 3 commits into from
Feb 5, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jan 23, 2020

cherry-pick #14547 to release-3.0


Signed-off-by: Lonng [email protected]

What problem does this PR solve?

This PR fixes the issue that the result of parse string to DATETIME/TIME incompatible with MySQL.

MySQL result:

mysql> select convert('4710072', DATEtime);
+------------------------------+
| convert('4710072', DATEtime) |
+------------------------------+
| 2047-10-07 02:00:00          |
+------------------------------+
1 row in set (0.00 sec)

mysql> select convert('4294967295 0:59:59', time);
+-------------------------------------+
| convert('4294967295 0:59:59', time) |
+-------------------------------------+
| 838:59:59                           |
+-------------------------------------+
1 row in set, 1 warning (0.00 sec)

What is changed and how it works?

  1. Support parse YYMMDDH format string.
  2. Check the overflow of duration hours.

Check List

Tests

  • Unit test

Release note

  • Fixes the issue that the result of parse string to DATETIME/TIME incompatible with MySQL.

@sre-bot
Copy link
Contributor Author

sre-bot commented Jan 23, 2020

/run-all-tests

@shenli
Copy link
Member

shenli commented Jan 27, 2020

LGTM

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Feb 5, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Feb 5, 2020

Your auto merge job has been accepted, waiting for 14615

@lonng
Copy link
Contributor

lonng commented Feb 5, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Feb 5, 2020

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

@sre-bot
Copy link
Contributor Author

sre-bot commented Feb 5, 2020

/run-all-tests

@sre-bot sre-bot merged commit 239c7c4 into pingcap:release-3.0 Feb 5, 2020
@lonng lonng added this to the v3.0.10 milestone Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants