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 json to datetime didn't have a correct fsp #53352

Closed
YangKeao opened this issue May 17, 2024 · 1 comment · Fixed by #53535 · May be fixed by #53363
Closed

Cast json to datetime didn't have a correct fsp #53352

YangKeao opened this issue May 17, 2024 · 1 comment · Fixed by #53535 · May be fixed by #53363
Assignees
Labels

Comments

@YangKeao
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (j json);
insert into t values (cast(cast("2024-10-24 11:11:11.12346" as datetime(6)) as json));
select cast(j as datetime(6)) from t;

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

+----------------------------+
| cast(j as datetime(6))     |
+----------------------------+
| 2024-10-24 11:11:11.123460 |
+----------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

+------------------------+
| cast(j as datetime(6)) |
+------------------------+
| 2024-10-24 11:11:11    |
+------------------------+
1 row in set (0.00 sec)

Actually, there is another bug: insert into t values (cast("2024-10-24 11:11:11.12346" as datetime(6))); will fail on MySQL, but it successes on TiDB.

4. What is your TiDB version? (Required)

@YangKeao YangKeao added the type/bug This issue is a bug. label May 17, 2024
@YangKeao
Copy link
Member Author

YangKeao commented May 17, 2024

It doesn't affect the real data, so it doesn't affect the unqiueness or any other property of MVI. Not a big issue.

I found this issue when I was trying to fix #53243. I'll also fix this issue later.

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