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

fix the STR_TO_DATE incompatible between MySQL and TiDB (#12623) #12757

Merged
merged 1 commit into from
Oct 16, 2019
Merged

fix the STR_TO_DATE incompatible between MySQL and TiDB (#12623) #12757

merged 1 commit into from
Oct 16, 2019

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Oct 16, 2019

cherry-pick #12623 to release-2.1


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

What problem does this PR solve?

The result of select str_to_date('20190101','%Y%m%d%H%i%s') is incompitable between MySQL and TiDB.

MySQL

mysql> select str_to_date('20190101','%Y%m%d%H%i%s');
+----------------------------------------+
| str_to_date('20190101','%Y%m%d%H%i%s') |
+----------------------------------------+
| 2019-01-01 00:00:00                    |
+----------------------------------------+
1 row in set (0.01 sec)

TiDB

mysql> select str_to_date('20190101','%Y%m%d%H%i%s');
+----------------------------------------+
| str_to_date('20190101','%Y%m%d%H%i%s') |
+----------------------------------------+
| NULL                                   |
+----------------------------------------+
1 row in set (0.01 sec)

What is changed and how it works?

Fix it.

Check List

Tests

  • Unit test

Release note

  • fix the STR_TO_DATE incompatible between MySQL and TiDB

@lonng
Copy link
Contributor Author

lonng commented Oct 16, 2019

/run-all-tests

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

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 16, 2019
@ngaut ngaut merged commit 3ba8b41 into pingcap:release-2.1 Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants