Version 5.1.37 is a maintenance release of the production 5.1 branch. It is suitable for use with MySQL Server versions 5.5, 5.6, and 5.7. It is also the first release of MySQL Connector/J to support the Java Database Connectivity (JDBC) 4.2 API.
methodCompressedInputStream.getNextPacketFromServer()
has been refactored to reduce memory use and garbage collection efforts caused by the use of the inflater. (Bug #21648826, Bug #78106)The code for executing a
REPLACE
statement whenrewriteBatchedStatements=true
has been refactored by putting multiple batched statements into a single query, making it work more like anINSERT
statement. This increases the efficiency for runningREPLACE
statements. Thanks to Jie Han for contributing the code. (Bug #21429909, Bug #77681)A new connection property,
sendFractionalSeconds=true|false
, has been introduced. It controls whether fractional seconds in timestamps are to be truncated on the client side or to be sent to the server side for truncation there. See the entry for the new property in Configuration Properties for Connector/J for details. Thanks to Kwon Nam Son for contributing the code. (Bug #21304726, Bug #77449)A new connection property,
enableEscapeProcessing
, has been introduced for supporting JDBC 4.2. It sets the default escape processing behavior for Statement objects. See the entry for the new property in Configuration Properties for Connector/J for details.Connector/J now supports the JSON data type, which has been supported by the MySQL server since release 5.7.8.
A
ClassCastException
resulted for a Fabric connection whenrewriteBatchedStatements
was “true” and a batch update was rewritten. (Bug #21876798)A number of regression tests in the testsuite failed when they were run against MySQL 5.7, because the
NO_AUTO_CREATE_USER
SQL mode had become the default behavior of the server since MySQL 5.7.7, making someGRANT
statements in the test fail when a new user had to be created. With this fix,CREATE USER
statements have been added to the regressions tests when needed, to prevent the test failures. (Bug #21697684, Bug #78225)Connecting to MySQL 5.0 and 5.1 using Connector/J 5.1.36 resulted in an
SQLException
, with a complaint for an “Unknown system variable 'language'”. (Bug #21415165, Bug #77665)The
IS_GENERATEDCOLUMN
field was empty in the result returned byDatabaseMetaData.getColumns()
. This fix corrects the field so that it contains aYES
orNO
according to whether the column is generated or not. (Bug #20969312, Bug #76859)getTypeInfo()
returned an incorrectPRECISION
value of “255” for the data type ofVARCHAR
. The return value has been corrected to “65535.” (Bug #20675539, Bug #76187)When a connection is forcefully closed with
abortInternal()
in theConnectionImpl
class, a null point exception sometimes resulted. This is now avoided by putting the associatedthis.io.releaseResources()
call inside a try block, so that the exception, unavoidable due to a race condition, can be properly caught and ignored. (Bug #20536592, Bug #75849)If the MySQL server's default authentication method was SHA256 but neither one of the Connector/J connection properties
allowPublicKeyRetrieval
andserverRSAPublicKeyFile
was set, the authentication failed with aTransientConnectionException
, complaining that the public key could not be retrieved. With this fix, authentication continues in the situation, allowing other enabled authentication methods to be tried. (Bug #20433047, Bug #75670)When a lock wait timeout occurred, an
SQLException
was thrown while anSQLTransientException
should be thrown instead. It was due to a wrong SQLState number used in the code, which has now been fixed. (Bug #16634180)When the time zone on the MySQL server was configured to “GMT” but the client was in a different time zone, Connector/J would make wrong adjustments for event timestamps when working with the server. (Bug #11758179, Bug #50348)