Bug #3498 INTERVAL doesn't like big numbers
Submitted: 18 Apr 2004 21:32 Modified: 28 Apr 2004 14:44
Reporter: Alex Seropian Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.18-standard-log OS:Mac OS X (Mac OS X Server 10.3.3)
Assigned to: Michael Widenius CPU Architecture:Any

[18 Apr 2004 21:32] Alex Seropian
Description:
Large (2^31) numbers in INTERVAL return incorrect results.

How to repeat:
mysql> SELECT "1904-01-01 00:00:00" + INTERVAL 2147483647 SECOND;
+----------------------------------------------------+
| "1904-01-01 00:00:00" + INTERVAL 2147483647 SECOND |
+----------------------------------------------------+
| 1972-01-19 03:14:07                                |
+----------------------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT "1904-01-01 00:00:00" + INTERVAL 2147483648 SECOND;
+----------------------------------------------------+
| "1904-01-01 00:00:00" + INTERVAL 2147483648 SECOND |
+----------------------------------------------------+
| 1835-12-12 20:45:52                                |
+----------------------------------------------------+
1 row in set (0.01 sec)
[28 Apr 2004 14:44] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

I have now extended the interval for hour, minute and seconds to allow handling of the full datetime range.

Fix will be in 4.0.19 and 4.1.2