Fixes bugs found since release 5.1.21.
com.mysql.jdbc.getCharsetNameForIndex()method was made more efficient, resulting in better performance for queries against tables containing many columns with string data types. (Bug #14236302, Bug #65508)
LoadBalancingConnectionProxy.pickNewConnection()method could incorrectly flag the current connection as invalid after testing another connection. The selection process could choose another (potentially offline) host, leading to a “connection is closed” error when trying to use a connection after re-balancing:
No operations allowed after connection closed. Connection closed after inability to pick valid new connection during fail-over.
useNanosForElapsedTime=truespecified in the connection URL, query and fetch duration were not reported correctly. The
com.mysql.jdbc.MysqlIO.sqlQueryDirect()method always measured times in milliseconds rather than switching between milliseconds and nanoseconds. (Bug #14273046, Bug #57662)
ResultSetobjects created by the
getGeneratedKeys()method were not being automatically closed, leading to potential memory leaks if the application did not explicitly close the
ResultSetobjects. (Bug #14192873, Bug #65503)
getVersionColumns()method, which formerly always returned an empty result set. Now this method returns the timestamp columns that are updated every time a row is changed. (Bug #13636546, Bug #63800)
Connecting to a server that used a
UCS2character set would throw an exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??' at line 1
Now, Connector/J sets
UTF-8when the server character set is
UCS2. Because the Connector/J UTF-8 implementation does not cover all UCS-2 characters, note that truncation might occur in some cases. (Bug #11751035, Bug #41752)
Connector/J now avoids synchronization issues in terms of locking order and prepared statements.