Bug #13685 setting useConfigs=3-0-Compat in Connection URL causes SQLException
Submitted: 1 Oct 2005 16:31 Modified: 31 Mar 2014 9:45
Reporter: Richard Beauchamp Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:3.1.10 OS:Windows (Windows XP)
Assigned to: Alexander Soklakov CPU Architecture:Any

[1 Oct 2005 16:31] Richard Beauchamp
Description:
Setting the useConfigs property to 3-0-Compat to maintain Connector/J 3.0.x compatibility causes a SQLException on connection.

This generates the following exception 

java.sql.SQLException: The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value 'ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL' is not in this set.
	at com.mysql.jdbc.ConnectionProperties$ConnectionProperty.validateStringValues(ConnectionProperties.java:302)
	at com.mysql.jdbc.ConnectionProperties$StringConnectionProperty.initializeFrom(ConnectionProperties.java:509)
	at com.mysql.jdbc.ConnectionProperties$ConnectionProperty.initializeFrom(ConnectionProperties.java:202)
	at com.mysql.jdbc.ConnectionProperties.initializeProperties(ConnectionProperties.java:2340)
	at com.mysql.jdbc.Connection.initializeDriverProperties(Connection.java:3617)
	at com.mysql.jdbc.Connection.<init>(Connection.java:1471)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)

How to repeat:
Set connection  URL to 

jdbc:mysql://localhost:3306/test?useConfigs=3-0-Compat

And connect...

Suggested fix:
3-0-Compat.properties has:
zeroDateTimeBehavior=ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL

Change 3-0-Compat.properties to:
zeroDateTimeBehavior=convertToNull
[2 Oct 2005 10:47] Vasily Kishkin
Sorry...I was not able to reporduce the bug. I tested connector 3.1.10 and mysqld 5.1.14-rc. Could you please say me more information about the bug ?
[4 Oct 2005 8:36] Richard Beauchamp
Bug report test case that shows this problem

Attachment: MyBugReport.java (text/plain), 1.19 KiB.

[4 Oct 2005 8:38] Richard Beauchamp
The test case I've attached produces the follow error using Connector/J 3.1.10 and server 5.0.13-rc.

java.sql.SQLException: The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value 'ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL' is not in this set.
	at com.mysql.jdbc.ConnectionProperties$ConnectionProperty.validateStringValues(ConnectionProperties.java:302)
	at com.mysql.jdbc.ConnectionProperties$StringConnectionProperty.initializeFrom(ConnectionProperties.java:509)
	at com.mysql.jdbc.ConnectionProperties$ConnectionProperty.initializeFrom(ConnectionProperties.java:202)
	at com.mysql.jdbc.ConnectionProperties.initializeProperties(ConnectionProperties.java:2340)
	at com.mysql.jdbc.Connection.initializeDriverProperties(Connection.java:3617)
	at com.mysql.jdbc.Connection.<init>(Connection.java:1471)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)
	at com.mysql.jdbc.util.BaseBugReport.getConnection(BaseBugReport.java:261)
	at com.mysql.jdbc.util.BaseBugReport.getConnection(BaseBugReport.java:241)
	at com.mysql.jdbc.util.BaseBugReport.getNewConnection(BaseBugReport.java:227)
	at com.mysql.jdbc.util.BaseBugReport.getConnection(BaseBugReport.java:211)
	at MyBugReport.runTest(MyBugReport.java:49)
	at com.mysql.jdbc.util.BaseBugReport.run(BaseBugReport.java:150)
	at MyBugReport.main(MyBugReport.java:53)
[5 Oct 2005 12:03] Vasily Kishkin
Thanks for test case, but I was not able to reproduce the bug with your test case. Your test case works fine. I also use Connector/J 3.1.10. Could you please test your test case on mysql 5.1.14 ?
[6 Nov 2005 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[31 Mar 2014 9:45] Alexander Soklakov
I close this report as "Can't repeat" because there is no feedback for a long time and codebase is too old. Please, feel free to reopen it if the problem still exists in current driver.