Bug #8929 Timestamp values with a date > 10/29/9997 cause problems
Submitted: 3 Mar 2005 19:51 Modified: 10 Mar 2005 20:36
Reporter: James Duerr Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.4 OS:Windows (Windows XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[3 Mar 2005 19:51] James Duerr
Description:
I use High value timestamps to show things are active, however if I use a timestamp of 9999/12/31 (my prefered timestamp) I get System.ArgumentOutOfRangeException.

If I change the timestamp back to 9997/10/29 (any time) it works okay, if I move it forwards one day to 9997/10/30 I get an exception

How to repeat:
reader = mySelect.ExecuteReader(); (where the reader is setup to read a row from a table which has a timestamp with a date > 9997/10/29)

reader.Read(); (this appears to be the statement that causes the exception).

Suggested fix:
Change it so that the reader.Read(); can cope with the number of ticks in a date > 9997/10/29
[10 Mar 2005 15:05] Reggie Burnett
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

James

This is happening because a timestamp column cannot take a value up to 9999-12-31.  This page ->http://dev.mysql.com/doc/mysql/en/timestamp-pre-4-1.html  shows the valid range of timestamp columns.  Check this line "TIMESTAMP values may range from the beginning of 1970 to partway through the year 2037, with a resolution of one second"

So what is happening is that you giving an out of range value to MySQL and it is silently converting it to '0000-00-00' which the connector cannot represent as a DateTime.  You can check for the exception or read up in the docs about using the "allow zero datetime" option.
[10 Mar 2005 20:36] Reggie Burnett
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:

Actually I discovered the problem after reviewing a separate bug report related to the same issue.  This has been fixed now in 1.0.5