DEV Community

Cover image for I found a really odd bug on Mysql 8

I found a really odd bug on Mysql 8

jorgecc profile image Jorge Castro ・2 min read

And I feel like a cow

I tried to insert this value '2014-09-07 00:00:00' in a TIMESTAMP column and it returns the next message:

Error Code: 1292. Incorrect datetime value: '2014-09-07 00:00:00' for column 'last_update' at row 1

However, if I try to insert the next value '2014-09-06 00:00:00' // day 06 instead of 07. it works.

What fails:

'2014-09-07 00:00:00'
'2014-09-07 00:01:01'
'2014-09-07 00:22:22'
'2014-09-07 00:00:22'

What doesn't fail

'2014-09-06 00:00:00'
'2014-09-07 01:00:00' // same day but different hour.
'2014-09-08 00:00:00'

I tried on another machine (Windows Server) with the same result.

Do you want to replicate it?

Then try this one


insert into dummy(timecol) values('2014-09-07 00:00:00');
Enter fullscreen mode Exit fullscreen mode

What's going on with 2014-09-07 at 0 hours?.

I have some theories about this date that involves the Illuminati.

It is the link to the bug report if you want to collaborate

ps: It is the third time that I found one of those weird bugs that happen in a specific case and a specific number.


This bug works (or fails) if:

  • Windows uses the timezone of GMT -4:00 Santiago (with daily saving). But apparently, it doesn't work with other zones, including GMT -4::00 Atlantic Canada.
  • And default-time-zone is not set in the configuration of MySQL (usually it is not set).
  • And if we try to insert 2014-09-07 00:00:00 in a timestamp field (apparently it works with DateTime fields).

So this bug is triggered for a specific zone in a specific time and under a specific type of column.

Weird as f*.. (f* = funk)

Discussion (1)

dk profile image
Dunning-Kruger • Edited

Doesn't the clock in Santiago de Chile jump from 2014-09-06 23:59:59 to 2014-09-07 01:00:00?

Basically a duplicate of but with a different timezone.

Forem Open with the Forem app