Fixes bugs found since release 5.1.18.
-
For a UTF-8 table using a collation other than the default (
utf8_general_ci
), the precision of theResultSetMetaData
could be different from the precision specified in theCREATE TABLE
statement. The fix corrects the return value fromgetMaxBytesPerChar()
.This fix changes the behavior of some connection string parameters.
useDynamicCharsetInfo
no longer has any effect. With the settingcacheServerConfiguration=true
, the cached settings also include the results of theSHOW CHARACTER SET
statement. (Bug #13495590, Bug #63456) -
Added support for pluggable authentication. via the
com.mysql.jdbc.AuthenticationPlugin
interface (which extends the standard “extension” interface). Examples are incom/mysql/jdbc/authentication
and intestsuite.regression.ConnectionRegressionTest.
This feature introduces three new connection properties:authenticationPlugins
defines a comma-delimited list of classes that implementcom.mysql.jdbc.AuthenticationPlugin
and are used for authentication unless disabled by thedisabledAuthenticationPlugins
property.disabledAuthenticationPlugins
defines a comma-delimited list of classes implementingcom.mysql.jdbc.AuthenticationPlugin
or mechanisms, i.e.mysql_native_password
. The authentication plugins or mechanisms cannot be used for authentication. Authentication will fail if it requires one of these classes. It is an error to disable the default authentication plugin, either the one named bydefaultAuthenticationPlugin
property or the hardcoded one ifdefaultAuthenticationPlugin
property is not set.defaultAuthenticationPlugin
defines the name of a class implementingcom.mysql.jdbc.AuthenticationPlugin
, which is used as the default authentication plugin. It is an error to use a class that is not listed inauthenticationPlugins
and is not one of the built-in plugins. It is an error to set as default a plugin that is disabled by being listed in thedisabledAuthenticationPlugins
property. It is an error to set this value to null or the empty string; there must be at least one valid default authentication plugin specified for the connection, meeting all the constraints listed above.
Performance: An unnecessary call to
bind()
during socket operations could limit scalability on some platforms. (Bug #13875070, Bug #63811)setMaxRows
was not correctly processed during metadata collection for client-side prepared statements, causing the entire result set to be fetched and possibly leading to an out-of-memory error. (Bug #13839395, Bug #64621)A problem with processing escape sequences (in
com.mysql.jdbc.EscapeProcessor#escapeSQL
) could cause certain statements to fail. For example, aCREATE TABLE
statement with a clause such asCONSTRAINT `fk_`
was not parsed correctly. (Bug #13612316, Bug #63526)The
sjis
character set was incorrectly mapped toMS392
, which was in turn mapped tocp932
, resulting in garbled characters in some cases. In Connector/J 5.1.19, the mappings of character sets and collations were refactored to avoid such multi-step mappings. (Bug #13589875)Underprivileged execution of stored procedures fixed. (Bug #13508993, Bug #61203)
A combination of failover connections, proxied or prepared statements, and database connection pool could cause a memory leak due to improper implementation of
equals()
. (Bug #13441718, Bug #63284)com.mysql.jdbc.ResultSetRow.getTimestampFast()
did not account for all validTIME
lengths. (Bug #60582, Bug #16592635)The
Connection.changeUser()
method did not check for closed connections, leading toNullPointerException
errors when this method was called on a closed connection.Reduced the memory overhead for server-side prepared statements. Each prepared statement allocated a 4K buffer for converting streams. Now this allocation is skipped when no
set*Stream()
methods have been used.