We're updating the issue view to help you get more done.Learn more

Bad value inserted into a TIME field on truncation

MariaDB [test]> drop table if exists t1; create table t1 (a time); insert into t1 values ('10:20:30'),('10:20:30+'),('2001-01-01 10:20:30'),('2001-01-01 10:20:30+'); show warnings; select * from t1;
Query OK, 0 rows affected (0.08 sec)
Query OK, 0 rows affected (0.36 sec)
Query OK, 4 rows affected, 3 warnings (0.08 sec)
Records: 4  Duplicates: 0  Warnings: 3

+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1265 | Data truncated for column 'a' at row 2 |
| Note    | 1265 | Data truncated for column 'a' at row 3 |
| Warning | 1265 | Data truncated for column 'a' at row 4 |
+---------+------+----------------------------------------+
3 rows in set (0.00 sec)

+----------+
| a        |
+----------+
| 10:20:30 |
| 10:20:30 |
| 10:20:30 |
| 34:20:30 |
+----------+
4 rows in set (0.00 sec)

The last value '34:20:30' is wrong.
The expected value is '10:20:30'.

Status