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

str_to_date() Microseconds with leading zeros are not converted correctly in TiDB #30078

Closed
ramanich1 opened this issue Nov 23, 2021 · 1 comment · Fixed by #30122
Closed
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ramanich1
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SET sql_mode = default;
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as a;

2. What did you expect to see? (Required)

+----------------------------+
| a                          |
+----------------------------+
| 2003-01-02 10:11:12.001200 |
+----------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

+----------------------------+
| a                          |
+----------------------------+
| 2003-01-02 10:11:12.120000 |
+----------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

----------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0-alpha-67-g17edc5758
Edition: Community
Git Commit Hash: 17edc5758fbf865cada7e156318c41d3ee8a7501
Git Branch: master
UTC Build Time: 2021-11-16 02:57:45
GoVersion: go1.17.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
@ramanich1 ramanich1 added the type/bug The issue is confirmed as a bug. label Nov 23, 2021
@ramanich1 ramanich1 changed the title STR_TO_DATE() Microseconds are not converted correctly in TiDB str_to_date() Microseconds with leading zeros are not converted correctly in TiDB Nov 23, 2021
@ChenPeng2013 ChenPeng2013 added affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/critical sig/execution SIG execution labels Nov 24, 2021
@wjhuang2016 wjhuang2016 self-assigned this Nov 24, 2021
@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

ti-chi-bot pushed a commit that referenced this issue Dec 20, 2021
ti-chi-bot pushed a commit that referenced this issue Feb 9, 2022
ti-chi-bot pushed a commit that referenced this issue Apr 15, 2022
ti-chi-bot pushed a commit that referenced this issue Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants