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

casting Time to Year gives the wrong result #48557

Closed
YangKeao opened this issue Nov 13, 2023 · 0 comments · Fixed by #48565
Closed

casting Time to Year gives the wrong result #48557

YangKeao opened this issue Nov 13, 2023 · 0 comments · Fixed by #48565
Assignees
Labels
component/expression severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

Bug Report

1. Minimal reproduce step (Required)

select cast(cast('22:03' as time) as year);

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

mysql> select cast(cast('22:03' as time) as year);
+-------------------------------------+
| cast(cast('22:03' as time) as year) |
+-------------------------------------+
|                                2023 |
+-------------------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

mysql> select cast(cast('22:03' as time) as year);
+-------------------------------------+
| cast(cast('22:03' as time) as year) |
+-------------------------------------+
|                              220300 |
+-------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                              |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.21.3
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@YangKeao YangKeao self-assigned this Nov 13, 2023
@YangKeao YangKeao changed the title Casting Time to Year gives the wrong result casting Time to Year gives the wrong result Nov 13, 2023
@jebter jebter added the sig/execution SIG execution label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants