Bug #40610 Date and time functions like DATE_SUB(), DATE_ADD() are not leap second enabled.
Submitted: 10 Nov 2008 7:17 Modified: 19 Nov 2008 16:18
Reporter: Mikiya Okuno Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any

[10 Nov 2008 7: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 10:03] Georgi Kodinov
Related to bug #39920
[19 Nov 2008 16: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.