Bug #17901 Wrong documented date range
Submitted: 3 Mar 2006 17:09 Modified: 3 Mar 2006 18:19
Reporter: Matthew Schultz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:N/A
Assigned to: CPU Architecture:Any

[3 Mar 2006 17:09] Matthew Schultz
Description:
The documented allowed date range for the date and datetime data types is wrong here: http://dev.mysql.com/doc/refman/4.1/en/date-and-time-type-overview.html

In multiple places on this page, it states: 

The supported range is '1000-01-01' to '9999-12-31'.

The actual supported date range is in fact 0000-01-01 to 9999-12-31.  For years less than 1000 and greater than 0, they must be padded on the left with zeros according to the iso 8601 standard.  e.g. 999 is 0999, 99 is 0099 and 9 is 0009.

How to repeat:
Documentation error at this url: 
http://dev.mysql.com/doc/refman/4.1/en/date-and-time-type-overview.html

Suggested fix:
Change the text to state the supported date/datetime range is 0000-01-01 to 9999-12-31.
[3 Mar 2006 17:43] Paul DuBois
The manual is correct as written.  The supported range
begins with the year 1000. You might be able to use years
before that, but such use is not supported.
[3 Mar 2006 17:57] Matthew Schultz
What does supported mean?  Does anything break (i.e. date functions) if a year less than 1000 is entered?
[3 Mar 2006 18:08] Paul DuBois
Supported means that date operations should work correctly
for years >= 1000.  Not supported for years < 1000 means that
although you might observe correct behavior, we make no
guarantee.
[3 Mar 2006 18:11] Matthew Schultz
I just tested the date_add function and it doesn't have any problems doing negative intervals before 1000-01-01.  So things seem to work with years less 1000.  So if you guys are worried about saying "supported", you could at least say this in the documentation:

The unsupported range for the date/datetime data type is 0000-01-01 to 9999-12-31.
[3 Mar 2006 18:19] Matthew Schultz
Never mind.  I tested the to_days function and it doesn't seem to like years less than 0200.  It's probably better to make a feature request.