Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.2.0, 1.3.0
-
None
-
Ubuntu 14.04, MySQL 5.5.43-0ubuntu0.14.04.1, MariaDB Connector/J 1.3.0
Description
I'm not sure if this is a bug or if it's intentional, but MariaDB Connector/J behaves differently from mysql-connector-java when inserting lines without values on not null columns, when sql_mode doesn't include STRICT_TRANS_TABLES.
With this table:
CREATE TABLE test1 ( |
col1 VARCHAR(64) NOT NULL |
) ;
|
this statement:
INSERT INTO test1 () VALUES () |
succeeds with MariaDB Connector/J (1.3.0 and 1.2.0), but with mysql-connector-java (5.1.37), it throws a SQLException as a value for col1 is missing.
If sql_mode is set to STRICT_TRANS_TABLES both drivers behave the same (throwing exception), so a work-around is maybe to add "?sessionVariables=sql_mode=STRICT_TRANS_TABLES" to the connection URL.
(Storage engine is INNODB. Java-version on client is 8u60. Client runs on the same machine as the server.)