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

cast datetime as decimal wrong result #4151

Closed
guo-shaoge opened this issue Feb 28, 2022 · 0 comments · Fixed by #4152
Closed

cast datetime as decimal wrong result #4151

guo-shaoge opened this issue Feb 28, 2022 · 0 comments · Fixed by #4152
Assignees
Labels

Comments

@guo-shaoge
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table test.t1;
create table test.t1(c1 datetime(5));
insert into test.t1 values('2022-10-10 10:10:10.12345');
alter table test.t1 set tiflash replica 1;
set @@tidb_isolation_read_engines='tiflash'; set @@tidb_enforce_mpp = 1; select cast(test.t1.c1 as decimal(17, 3)) from test.t1;

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

mysql> select cast(test.t1.c1 as decimal(17, 3)) from test.t1;
+------------------------------------+
| cast(test.t1.c1 as decimal(17, 3)) |
+------------------------------------+
|                 20221010101010.123 |
+------------------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

mysql> select cast(test.t1.c1 as decimal(17, 3)) from test.t1;
+------------------------------------+
| cast(test.t1.c1 as decimal(17, 3)) |
+------------------------------------+
|                  1774256937300.572 |
+------------------------------------+
1 row in set (0.01 sec)

4. What is your TiFlash version? (Required)

master

@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Feb 28, 2022
@guo-shaoge guo-shaoge self-assigned this Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant