Version 5.1.30 is a maintenance release of the production 5.1 branch. It is suitable for use with many MySQL Server versions, including 4.1, 5.0, 5.1, 5.4, 5.5, and 5.6.
Replaced a for loop with the
System.arraycopy()
method for copying array values in theMysqlIO.unpackNativeEncodedColumn()
andLoadBalancingConnectionProxy.addHost()
methods, in order to improve the two methods' performance. (Bug #18327245, Bug #71861)Avoided the use of an iterator over the list of statement interceptors in the methods
MysqlIO.invokeStatementInterceptorsPost()
andMysqlIO.invokeStatementInterceptorsPre()
, so that Connector/J does not increase the stack size unnecessarily. (Bug #18236388, Bug #71679)The
Field.getStringFromBytes()
method created a useless byte array when using JVM's converter and the encoding defined by the connection. This fix makes the method callStringUtils.toString()
using the original buffer instead of creating a temporary byte array for the call. (Bug #18228668, Bug #71623)Improved on the code for integer-to-hex conversion when building XA commands by avoiding the creation of temporary character arrays, thus enhancing performance. (Bug #18228302, Bug #71621)
It was intended that if a previous query on a connection had used the
setMaxRows()
method, in the next query, Connector/J would not cancel that by settingSQL_SELECT_LIMIT=DEFAULT
if the query contained aLIMIT
clause. However, in the actual implementation, the maximum row setting was reused in the subsequent query in various situations beyond expectation (for example, when a table name contains the string “limit” in it). This fix removes theLIMIT
-clause parsing and replaces it by a better way of controlling the maximum rows per session. (Bug #18110320, Bug #71396)There were sporadic cases of the key store file being open hundreds of times and causing some "Too many files open" errors. This fix makes sure that in com.mysql.jdbc.ExportControlled and in
MysqlIO.sendFileToServer()
, the input stream for the key store file is explicitly closed after use. (Bug #18107621, Bug #71432)When working with MySQL 5.6, calling
PreparedStatement.setTimestamp()
resulted in ajava.lang.StringIndexOutOfBoundsException
being thrown if theTimestamp
contained a fractional second. This fix corrects the digit truncation performed in theformatNanos()
method, which was the cause of the problem. (Bug #18091639)Calling
ResultSet.close()
on an already closed ResultSet caused a SQLException. While the exception was silently discarded, it did result in performance issues. This fix makes Connector/J comply with the Java specification that when a ResultSet object is already closed, application of theclose
method on it should be a no-op. (Bug #16722637, Bug #67318)Fixed the problem of the wrong source being provided when the build property
com.mysql.jdbc.noCryptoBuild
was set.