[MDEV-4898] Too many warnings when inserting a bad value into a TIMESTAMP column Created: 2013-08-14  Updated: 2017-11-05

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.2

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


 Description   

MariaDB [test]> drop table if exists t1; create table t1 (a timestamp); insert into t1 values (timestamp('2001-00-01 00:00:00.9999999')); show warnings; select * from t1;
Query OK, 0 rows affected (0.07 sec)
Query OK, 0 rows affected (0.19 sec)
Query OK, 1 row affected, 3 warnings (0.04 sec)
+---------+------+-------------------------------------------------------------------+
| Level   | Code | Message                                                           |
+---------+------+-------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect datetime value: '2001-00-01 00:00:00.9999999' |
| Warning | 1265 | Data truncated for column 'a' at row 1                            |
| Warning | 1292 | Truncated incorrect datetime value: '2001-00-01 00:00:00.9999999' |
+---------+------+-------------------------------------------------------------------+
3 rows in set (0.00 sec)
+---------------------+
| a                   |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
1 row in set (0.00 sec)

Notice two problems with the timestamp() parameter:

  • seven fractional digits
  • zero month

There are three warnings generated, with two of them being equal.
Looks too redundant. Either one or two warnings should be enough.



 Comments   
Comment by Alexander Barkov [ 2013-08-14 ]

Versions 5.3 and 5.5 do not seem to be affected.

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