Bug #8446 date time stamp of "0000-00-00 00:00:00" halts execution
Submitted: 11 Feb 2005 17:56 Modified: 14 Feb 2005 15:18
Reporter: peter Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:3.1.6 OS:Any (*)
Assigned to: CPU Architecture:Any

[11 Feb 2005 17:56] peter
Description:

when doing a SELECT * from a table containing '0000-00-00 00:00:00' date time field using mysql-connector-java-3.1.6-bin.jar returns the following error:

java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 26 to TIMESTAMP.

MySQL version 4.1

mysql-connector-java-3.0.15-ga-bin.jar works fine

How to repeat:
create a table with a date time 

insert '0000-00-00 00:00:00' into the date time field

execute from java SELECT * from a_table
[14 Feb 2005 13:26] Aleksey Kishkin
tested on slackware 10 and on win xp
[14 Feb 2005 13:27] Aleksey Kishkin
test case. dtime contains one datatime field with 0000-00-00 00:00:00 value

Attachment: Bug8446.java (text/x-java), 751 bytes.

[14 Feb 2005 15:18] Mark Matthews
Please read the changelog and documentation regarding 'zeroDatetimeBehavior':

zeroDateTimeBehavior 	

What should happen when the driver encounters DATETIME values that are composed entirely of zeroes (used by MySQL to represent invalid dates)? Valid values are 'exception', 'round' and 'convertToNull'. 	

default: exception