Fixes bugs found since release 5.1.10.
Functionality added or changed:
Replication connections, those with URLs that start with jdbc:mysql:replication, now use a jdbc:mysql:loadbalance connection for the slave pool. This means that it is possible to set load balancing properties such as
loadBalanceBlacklistTimeoutandloadBalanceStrategyto choose a mechanism for balancing the load, and failover or fault tolerance strategy for the slave pool. (Bug#49537)
Bugs fixed:
NullPointerExceptionsometimes occurred ininvalidateCurrentConnection()for load-balanced connections. (Bug#50288)The
deleteRowmethod caused a full table scan, when using an updatable cursor and a multibyte character set. (Bug#49745)For pooled connections, Connector/J did not process the session variable
time_zonewhen set using the URL, resulting in incorrect timestamp values being stored. (Bug#49700)The
ExceptionInterceptorclass did not provide aConnectioncontext. (Bug#49607)Ping left closed connections in the liveConnections map, causing subsequent Exceptions when that connection was used. (Bug#48605)
Using
MysqlConnectionPoolDataSourcewith a load-balanced URL generated exceptions of typeClassCastException:ClassCastException in MysqlConnectionPoolDataSource Caused by: java.lang.ClassCastException: $Proxy0 at com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.getPooledConnection(MysqlConne ctionPoolDataSource.java:80)
java.lang.ClassCastException: $Proxy2 at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeQuery(StatementWrapper.java:744)
The implementation for load-balanced
Connectionused a proxy, which delegated method calls, includingequals()andhashCode(), to underlyingConnectionobjects. This meant that successive calls tohashCode()on the same object potentially returned different values, if the proxy state had changed such that it was utilizing a different underlying connection. (Bug#48442)The batch rewrite functionality attempted to identify the start of the
VALUESlist by looking for “VALUES ” (with trailing space). However, valid MySQL syntax permitsVALUESto be followed by whitespace or an opening parenthesis:INSERT INTO tbl VALUES (1); INSERT INTO tbl VALUES(1);
Queries written with the above formats did not therefore gain the performance benefits of the batch rewrite. (Bug#48172)
A PermGen memory leaked was caused by the Connector/J statement cancellation timer (
java.util.Timer). When the application was unloaded the cancellation timer did not terminate, preventing the ClassLoader from being garbage collected. (Bug#36565)With the connection string option
noDatetimeStringSyncset totrue, and server-side prepared statements enabled, the following exception was generated if an attempt was made to obtain, usingResultSet.getString(), a datetime value containing all zero components:java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date