[MDEV-9680] Unable to insert valid value to TIMESTAMP column Created: 2016-03-03  Updated: 2016-03-03  Resolved: 2016-03-03

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 5.5.46
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Sergey Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: timestamp
Environment:

Linux 3.11.10-32-desktop x86_64 (OpenSUSE 13.1), Intel Core i5



 Description   

Unable to insert some valid values to TIMESTAMP column.
Steps to reproduce the bug:

  1. Create new database: `create database SANDBOX;`
  2. Create new table: `create table test (id int primary key auto_increment, time timestamp not null);`
  3. Insert new row: `insert into test (time) values ('1984-04-01 00:59:37');`
    Expected result:
    `Query OK, 1 row affected (X.XX sec)`
    Actual result:
    `ERROR 1292 (22007): Incorrect datetime value: '1984-04-01 00:59:37' for column 'time' at row 1`

Additional info:
Another one value that causes the error: '2000-03-26 02:15:36'.
But, if I try to insert, say, '1974-04-01 00:59:37' or '1994-04-01 00:59:37' or '2001-03-26 02:15:36', it inserts without any error.
The error also happens if I try to update columns to set these values.



 Comments   
Comment by Sergei Golubchik [ 2016-03-03 ]

But MariaDB is right — the datetime 1984-04-01 00:59:37 is invalid. There was never a moment in 1984-04-01 when your clock would've displayed 00:59:37, because immediately after 1984-03-31 23:59:59, they were displaying 1984-04-01 01:00:00. Summer time. In 1984 Russia switched to the summer time in April 1st, going from 00:00 to 01:00. See http://www.timeanddate.com/time/dst/1984a.html

Comment by Sergey [ 2016-03-03 ]

Wow. Thanks for clarifying.

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