You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
drop table if exists t;
create table t (a year);
insert into t values (2021);
select cast(a as datetime) from t;
2. What did you expect to see? (Required)
MySQL [test]> select cast(a as datetime) from t;
+---------------------+
| cast(a as datetime) |
+---------------------+
| NULL |
+---------------------+
1 row in set, 1 warning (0.000 sec)
MySQL [test]> show warnings;
+---------+------+----------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------+
| Warning | 1292 | Incorrect datetime value: '2021' |
+---------+------+----------------------------------+
1 row in set (0.000 sec)
3. What did you see instead (Required)
MySQL [test]> select cast(a as datetime) from t;
+---------------------+
| cast(a as datetime) |
+---------------------+
| 2021-00-00 00:00:00 |
+---------------------+
1 row in set (0.001 sec)
4. What is your TiDB version? (Required)
master
this bug is caused by #20233 , TiDB acts correctly before this PR, namely in e9b11b7
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master
this bug is caused by #20233 , TiDB acts correctly before this PR, namely in e9b11b7
The text was updated successfully, but these errors were encountered: