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 double as datetime is not compatible with tidb/mysql #3779

Closed
fzhedu opened this issue Dec 30, 2021 · 0 comments · Fixed by #5799
Closed

cast double as datetime is not compatible with tidb/mysql #3779

fzhedu opened this issue Dec 30, 2021 · 0 comments · Fixed by #5799

Comments

@fzhedu
Copy link
Contributor

fzhedu commented Dec 30, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

mysql> select cast(111 as datetime);
+-----------------------+
| cast(111 as datetime) |
+-----------------------+
| 2000-01-11 00:00:00   |
+-----------------------+
1 row in set (0.00 sec)

mysql> select cast(111.1 as datetime);
+-------------------------+
| cast(111.1 as datetime) |
+-------------------------+
| 2000-01-11 00:00:00     |
+-------------------------+
1 row in set (0.00 sec)

mysql> select cast(111.1 as datetime) from tdate;
+-------------------------+
| cast(111.1 as datetime) |
+-------------------------+
| 2000-01-11 00:00:00     |
+-------------------------+
1 row in set (0.00 sec)

mysql> set @@tidb_enforce_mpp=on;
Query OK, 0 rows affected (0.00 sec)

mysql> select cast(111.1 as datetime) from tdate;
+-------------------------+
| cast(111.1 as datetime) |
+-------------------------+
| NULL                    |
+-------------------------+
1 row in set (0.01 sec)

mysql> select cast(111 as datetime) from tdate;
+-----------------------+
| cast(111 as datetime) |
+-----------------------+
| 2000-01-11 00:00:00   |
+-----------------------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

master

@fzhedu fzhedu added the type/bug The issue is confirmed as a bug. label Dec 30, 2021
@mengxin9014 mengxin9014 self-assigned this Sep 1, 2022
ti-chi-bot pushed a commit that referenced this issue Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment