Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Cannot Reproduce
-
5.3.12, 5.5.34, 10.0.6
-
None
Description
mysql> create table t1 (a datetime);
|
Query OK, 0 rows affected (0.07 sec)
|
|
|
mysql> insert into t1 values (time('800:20:30'));
|
Query OK, 1 row affected (0.03 sec)
|
|
|
mysql> select * from t1;
|
+---------------------+
|
| a |
|
+---------------------+
|
| 0000-00-08 00:20:30 |
|
+---------------------+
|
1 row in set (0.00 sec)
|
The above result looks wrong.
Explicit conversion from time to datetime seems to return a much better result:
mysql> select cast(time('800:20:30') as datetime);
|
+-------------------------------------+
|
| cast(time('800:20:30') as datetime) |
|
+-------------------------------------+
|
| 0000-01-02 08:20:30 |
|
+-------------------------------------+
|
1 row in set (0.00 sec)
|