Bug #40610 Date and time functions like DATE_SUB(), DATE_ADD() are not leap second enabled.
Submitted: 10 Nov 2008 8:17 Modified: 19 Nov 2008 17:18
Reporter: Mikiya Okuno
Status: Won't fix
Category:Server: General Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Georgi Kodinov Target Version:5.0.74
Triage: Triaged: D2 (Serious)

[10 Nov 2008 8:17] Mikiya Okuno
Description:
Date and time functions like DATE_SUB(), DATE_ADD(), DATE_DIFF() and so forth are not
able to handle leap seconds correctly, even if a leap second enabled time zone is used.

How to repeat:
e.g.
mysql> SELECT DATE_ADD('2009-01-01 08:59:50', INTERVAL 20 SECOND);
+-----------------------------------------------------+
| DATE_ADD('2009-01-01 08:59:50', INTERVAL 20 SECOND) |
+-----------------------------------------------------+
| 2009-01-01 09:00:10                                 | 
+-----------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix:
class Item_date_add_interval should handle leap second correctly?
[18 Nov 2008 11:03] Georgi Kodinov
Related to bug #39920
[19 Nov 2008 17:18] Georgi Kodinov
After a discussion with Peter Gulutzan we agreed that we should not change what these
functions return based on what is in the time zone tables.
The MySQL standard implies that how this functions behave is implementation dependent.
We don't want to introduce compatibility problems.