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 tiflash #3556

Closed
wshwsh12 opened this issue Nov 29, 2021 · 1 comment · Fixed by #3581
Closed

Comments

@wshwsh12
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Similar to pingcap/tidb#30078

use test;
drop table t;
create table t(a varchar(30));
insert into t values("2003-01-02 10:11:12.0012");
alter table t set tiflash replica 1;
set tidb_enforce_mpp=1; set tidb_isolation_read_engines='tiflash';
select str_to_date(a, "%Y-%m-%d %H:%i:%S.%f") from t;

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

MySQL [test]> select str_to_date(a, "%Y-%m-%d %H:%i:%S.%f") from t;
+----------------------------------------+
| str_to_date(a, "%Y-%m-%d %H:%i:%S.%f") |
+----------------------------------------+
| 2003-01-02 10:11:12.001200             |
+----------------------------------------+
1 row in set (0.000 sec)

3. What did you see instead (Required)

[tidb]> select str_to_date(a, "%Y-%m-%d %H:%i:%S.%f") from t;
+----------------------------------------+
| str_to_date(a, "%Y-%m-%d %H:%i:%S.%f") |
+----------------------------------------+
| 2003-01-02 10:11:12.120000             |
+----------------------------------------+
1 row in set (0.004 sec)

4. What is your TiFlash version? (Required)

master, 5.3, 5.2, 5.1, 5.0

@wshwsh12 wshwsh12 added the type/bug The issue is confirmed as a bug. label Nov 29, 2021
@fuzhe1989
Copy link
Contributor

#3557

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

Successfully merging a pull request may close this issue.

4 participants