0

I would like to understand why, for a simple table created like :

show create table test;

CREATE TABLE `test` ( `start_timestamp` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1

I got a reject:

insert into test values('2016-03-27 02:00:00');

ERROR 1292 (22007): Incorrect datetime value: '2016-03-27 02:00:00' for column 'start_timestamp' at row 1

While just another timestamp in exactly the same format can be inserted, such as :

insert into test values('2016-03-27 01:00:00');

Query OK, 1 row affected (0.01 sec)

Are there any constraint on the timestamp values or settings, or it is a bug ?

I'm using: $ mysql --version mysql Ver 15.1 Distrib 10.2.9-MariaDB, for Linux (x86_64) using readline 5.1

Thanks a lot!

Bing
  • 83
  • 4
  • March 27, 2016 is suspicious because it is the day that daylight savings time moves the clock forward at 1 AM. Is 3/27/2016 at 2 AM the only day and time combination giving you an error? – Sam M Nov 25 '17 at 20:44
  • Look at the answer to this question: https://stackoverflow.com/questions/35602939/mysql-1292-incorrect-datetime-value – Sam M Nov 25 '17 at 20:49
  • Ah, very good point and it IS the problem. Now learned that. Thanks a lot! So we really have some invalid date, to be used as TIMESTAMP. – Bing Nov 25 '17 at 20:52

0 Answers0