Navigation Menu

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

Merged
merged 3 commits into from Oct 15, 2019
Merged

fix the STR_TO_DATE incompatible between MySQL and TiDB #12623

merged 3 commits into from Oct 15, 2019

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Oct 11, 2019

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

@codecov
Copy link

codecov bot commented Oct 11, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@15984f6). Click here to learn what that means.
The diff coverage is 100%.

@@             Coverage Diff             @@
##             master     #12623   +/-   ##
===========================================
  Coverage          ?   79.8518%           
===========================================
  Files             ?        462           
  Lines             ?     105007           
  Branches          ?          0           
===========================================
  Hits              ?      83850           
  Misses            ?      14944           
  Partials          ?       6213

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

@lonng lonng changed the title fix the STR_TO_DATE incompatible in MySQL and TiDB fix the STR_TO_DATE incompatible between MySQL and TiDB Oct 11, 2019
@wjhuang2016
Copy link
Member

LGTM

types/time.go Outdated Show resolved Hide resolved
wjhuang2016
wjhuang2016 previously approved these changes Oct 11, 2019
@wjhuang2016 wjhuang2016 dismissed their stale review October 11, 2019 07:38

Failed to select str_to_date('20190101', '%Y%m%d%f');

@sre-bot
Copy link
Contributor

sre-bot commented Oct 14, 2019

@AilinKid, @tiancaiamao, @wjhuang2016, PTAL.

@tiancaiamao
Copy link
Contributor

Please address comment @lonng

Signed-off-by: Lonng <heng@lonng.org>
@lonng lonng requested a review from a team as a code owner October 15, 2019 08:58
@ghost ghost requested review from qw4990 and XuHuaiyu and removed request for a team October 15, 2019 08:58
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
@lonng
Copy link
Contributor Author

lonng commented Oct 15, 2019

/run-all-tests

@pingcap pingcap deleted a comment from zyxbest Oct 15, 2019
@lonng
Copy link
Contributor Author

lonng commented Oct 15, 2019

/run-integration-common-test

@tiancaiamao
Copy link
Contributor

LGTM

@lonng lonng merged commit e80bab6 into pingcap:master Oct 15, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 15, 2019

cherry pick to release-3.0 in PR #12725

@sre-bot
Copy link
Contributor

sre-bot commented Oct 15, 2019

cherry pick to release-3.1 in PR #12726

@sre-bot
Copy link
Contributor

sre-bot commented Oct 15, 2019

cherry pick to release-2.1 failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants