Bug #24526 JDBC connector forces strict mode regardless of server setting
Submitted: 22 Nov 2006 23:29 Modified: 27 Nov 2006 16:49
Reporter: Dave Lennert Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.0.4 OS:Windows (Win XP Pro)
Assigned to: CPU Architecture:Any

[22 Nov 2006 23:29] Dave Lennert
Description:
The JDBC connector forces STRICT_TRANS_TABLES when connecting to a 5.0.2 or later server.  This forces strict mode regardless of the server setting.

This is in Connection.java, setupServerForTruncationChecks().

How to repeat:
Using 5.0.27-community-nt server with strict mode disabled.

Use mysql-connector-java-5.0.4-bin.jar and execute:

ALTER TABLE personalities ADD configuration text NOT NULL DEFAULT '';

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: BLOB/TEXT column 'configuration' can't have a default value

Per the resolution of Bug # 19498, this should be a warning rather than an error when the server is set in non-strict mode.  However the JDBC connector forces strict behavior.
[23 Nov 2006 10:30] Tonci Grgin
Hi Dave and thanks for your problem report. We are forcing this behavior as it is much more efficient, and faster of course, than checking each and every statement for warnings/errors. This is a design decision not likely to be changed.
[23 Nov 2006 10:34] Tonci Grgin
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Explanation: My fault, this is the duplicate of Bug#23371, already marked as "Not a bug".
[27 Nov 2006 16:49] Dave Lennert
Thanks.  I did search for duplicate reports, but didn't find that one.