Bug #76523 | unrepeatable example in the doc on leap second support | ||
---|---|---|---|
Submitted: | 30 Mar 2015 1:26 | Modified: | 30 Mar 2015 5:38 |
Reporter: | Peiran Song | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[30 Mar 2015 1:26]
Peiran Song
[30 Mar 2015 5:38]
MySQL Verification Team
Hello Peiran Song, Thank you for the report. I observed similar results(as shown in report) from 5.0.96, 5.1.73, 5.5.44, 5.6.25 and 5.7.8. Thanks, Umesh
[31 Mar 2015 13:23]
Jon Stephens
mysql> select unix_timestamp("2008-12-31 23:59:59"); +---------------------------------------+ | unix_timestamp("2008-12-31 23:59:59") | +---------------------------------------+ | 1230767999 | +---------------------------------------+ 1 row in set (0.00 sec) mysql> select unix_timestamp("2008-12-31 23:59:60"); +---------------------------------------+ | unix_timestamp("2008-12-31 23:59:60") | +---------------------------------------+ | 0.000000 | +---------------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> show warnings; +---------+------+-------------------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------------------+ | Warning | 1292 | Incorrect datetime value: '2008-12-31 23:59:60' | +---------+------+-------------------------------------------------+ 1 row in set (0.00 sec) mysql> select unix_timestamp("2009-01-01 00:00:00"); +---------------------------------------+ | unix_timestamp("2009-01-01 00:00:00") | +---------------------------------------+ | 1230768000 | +---------------------------------------+ 1 row in set (0.00 sec) We don't document misbehaviour. Misbehaviour is a software bug, and needs to be fixed.
[12 Jun 9:32]
Mattias Jonsson
Documentation and product is still not matching in 8.0.42 and 8.4.5. And I don't think MySQL is handling leap seconds, more than they can be expressed in DATETIME datatype. UNIX_TIMESTAMP function is closely related to: unix time - https://en.wikipedia.org/wiki/Unix_time which is without leap seconds TIMESTAMP datatype is closely related to time_t, when stored: https://en.cppreference.com/w/c/chrono/time_t - which is also without leap seconds. So I consider this as issues with the documentation, not in the MySQL Server. If you can show in any MySQL version and configuration that the document is correct, with the series of SQL commands and results, please do so and close this bug :)