Functionality added or changed:
When statements include
ON DUPLICATE UPDATE, andrewriteBatchedStatementsis set to true, batched statements are not rewritten into the formINSERT INTO table VALUES (), (), (), instead the statements are executed sequentially.
Bugs fixed:
Statement.getGeneratedKeys()returned two keys when usingON DUPLICATE KEY UPDATEand the row was updated, not inserted. (Bug#42309)When using the replication driver with
autoReconnect=true, Connector/J checks inPreparedStatement.execute(also called byCallableStatement.execute) to determine if the first character of the statement is an “S”, in an attempt to block all statements that are not read-only-safe, for example non-SELECTstatements. However, this also blockedCALLs to stored procedures, even if the stored procedures were defined asSQL READ DATAorNO SQL. (Bug#40031)With large result sets
ResultSet.findColumnbecame a performance bottleneck. (Bug#39962)Connector/J ignored the value of the MySQL Server variable
auto_increment_increment. (Bug#39956)Connector/J failed to parse
TIMESTAMPstrings for nanos correctly. (Bug#39911)When the
LoadBalancingConnectionProxyhandles aSQLExceptionwith SQL state starting with “08”, it callsinvalidateCurrentConnection, which in turn removes thatConnectionfromliveConnectionsand theconnectionsToHostsMap, but it did not add the host to the new global blacklist, if the global blacklist was enabled.There was also the possibility of a
NullPointerExceptionwhen trying to update stats, whereconnectionsToHostsMap.get(this.currentConn)was called:int hostIndex = ((Integer) this.hostsToListIndexMap.get(this.connectionsToHostsMap.get(this.currentConn))).intValue();
This could happen if a client tried to issue a rollback after catching a
SQLExceptioncaused by a connection failure. (Bug#39784)When configuring the Java Replication Driver the last slave specified was never used. (Bug#39611)
When an
INSERT ON DUPLICATE KEY UPDATEwas performed, and the key already existed, theaffected-rowsvalue was returned as 1 instead of 0. (Bug#39352)When using the random load balancing strategy and starting with two servers that were both unavailable, an
IndexOutOfBoundsExceptionwas generated when removing a server from thewhiteList. (Bug#38782)Connector/J threw the following exception when using a read-only connection:
java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed.
Connector/J was unable to connect when using a non-
latin1password. (Bug#37570)The
useOldAliasMetadataBehaviorconnection property was ignored. (Bug#35753)Incorrect result is returned from
isAfterLast()in streamingResultSetwhen usingsetFetchSize(Integer.MIN_VALUE). (Bug#35170)When
getGeneratedKeys()was called on a statement that had not been created withRETURN_GENERATED_KEYS, no exception was thrown, and batched executions then returned erroneous values. (Bug#34185)The
loadBalancebestResponseTimeblacklists did not have a global state. (Bug#33861)