Bug #30656 | DATE_ADD interval of 99999 fails, but 9999 works. | ||
---|---|---|---|
Submitted: | 27 Aug 2007 23:52 | Modified: | 31 Aug 2007 21:53 |
Reporter: | Daevid Vincent | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.41 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[27 Aug 2007 23:52]
Daevid Vincent
[28 Aug 2007 1:15]
Daevid Vincent
burried in the plethora of bullet points here: http://dev.mysql.com/doc/refman/5.0/en/datetime.html "For example, TIMESTAMP values cannot be earlier than 1970 or later than 2038." So that _is_ the root cause of the problem, but it's still a bug. There is no reason (from a mySQL user/PHP developer's perspective) that 2038 should be my upper year limit. I should be able to make any date up to "9999-12-31" We're making enterprise level tools that run at US Government offices, The entire state of Alaska, Military, Colleges, Fortune 500 companies.... In 21 years from now, all this will just fail miserably because of some obscure 2038 limitation? This is Y2K all over again -- unless this is upper bound is fixed.
[28 Aug 2007 1:17]
Jim Winstead
The DATETIME type does not have this limitation.
[28 Aug 2007 4:54]
Valeriy Kravchuk
Sorry, but this is not a bug. This limitation of TIMESTAMP data type is clearly described in the manual. Read also http://en.wikipedia.org/wiki/Year_2038_problem for some details. Just use proper data type, as already suggested.
[31 Aug 2007 21:53]
Daevid Vincent
So, I found out why we had to switch all of our datetimes to timestamps: http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html "The current time zone setting does not affect values in DATE, TIME, or DATETIME columns." So it appears this is a catch 22... In order to store things in UTC and then use the user's local TZ, you need to use 'timestamps'. But then you can't use them for years past 2038... However 'datetime' will store any date, but you can't store in UTC and display via the TZ setting. :-\