[MDEV-4900] Bad value inserted into a TIME field on truncation Created: 2013-08-14  Updated: 2018-02-07  Resolved: 2018-02-07

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.0.3, 5.5.32, 5.3.12
Fix Version/s: 10.3.5

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-15176 Storing DATETIME-alike VARCHAR data i... Closed

 Description   

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'.


Generated at Thu Feb 08 07:00:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.