Functionality added or changed:
When statements include
ON DUPLICATE UPDATE
, andrewriteBatchedStatements
is 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 UPDATE
and 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-SELECT
statements. However, this also blockedCALL
s to stored procedures, even if the stored procedures were defined asSQL READ DATA
orNO SQL
. (Bug#40031)With large result sets
ResultSet.findColumn
became 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
TIMESTAMP
strings for nanos correctly. (Bug#39911)When the
LoadBalancingConnectionProxy
handles aSQLException
with SQL state starting with “08”, it callsinvalidateCurrentConnection
, which in turn removes thatConnection
fromliveConnections
and 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
NullPointerException
when 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
SQLException
caused 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 UPDATE
was performed, and the key already existed, theaffected-rows
value 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
IndexOutOfBoundsException
was 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-
latin1
password. (Bug#37570)The
useOldAliasMetadataBehavior
connection property was ignored. (Bug#35753)Incorrect result is returned from
isAfterLast()
in streamingResultSet
when 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
loadBalance
bestResponseTime
blacklists did not have a global state. (Bug#33861)