5.1.47-bin.jar behaves like STRICT_ALL_TABLES mode is in effect.
Posted by: Richard Foletta
Date: July 10, 2019 11:40AM

My java application used to use mysql-connector-java-3.1.10-bin.jar to connect to a mysql server version 5.0.77 and when inserting a record with a field that has longer data than can fit in the column it would insert the data with the field truncated and give a warning.
The data gets inserted in the database with truncation which is what I want.

recently we had to support mysql server 8.0 so we re-compiled the java application with the mysql-connector-java-5.1.47-bin.jar.

When connecting to the 5.0.77 server with no configuration changes at all, the behavior has changed such that the record is no longer inserted, but instead gives a data truncated error as if the sql-mode STRICT_ALL_TABLES is enabled.

This mode is not enabled on the 5.0.77 server.

I have tried placing in the ~/.my.cnf file sql-mode="" to disable all modes and also in the /etc/my.cnf file with no affect.
In fact mysql complains that sql-mode and even sql_mode is not a valid option.

How can I get this behavior back to inserting truncated data?

Options: ReplyQuote


Subject
Written By
Posted
5.1.47-bin.jar behaves like STRICT_ALL_TABLES mode is in effect.
July 10, 2019 11:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.