MySQL Forums
Forum List  »  Announcements

MySQL Connector/J 5.1.23 has been released
Posted by: Jocelyn Ramilison
Date: February 05, 2013 07:18AM

Hello all,

MySQL Connector/J 5.1.23, a maintenance release of the production 5.1
branch has been released.  Connector/J is the Type-IV pure-Java JDBC
driver for MySQL.

Version 5.1.23 is suitable for use with many MySQL server versions,
including 4.1, 5.0, 5.1, 5.4, 5.5 and 5.6.

It is now available in source and binary form from the Connector/J
download pages at
and mirror sites as well as Maven-2 repositories.

As always, we recommend that you check the "CHANGES" file in the
download archive to be aware of changes in behavior that might affect
your application.

  * The driver now allows the mechanism for caching MySQL server
    configuration values replaceable at runtime, via the
    serverConfigCacheFactory property. The default is an
    implementation that is a per-VM concurrent map, keyed by URL.
    The driver will invalidate cache entries when SQLException
    exceptions that indicate communications errors are thrown (on
    the assumption that the server has been or is restarting). The
    driver also invalidates cache entries if the server version
    that is being connected to differs from the one that was
    present when the cached values were populated.
    To replace the default implementation, implement
    CacheAdapterFactory<String, Map<String, String>>, and specify
    the fully-qualified class name of this implementation for the
    serverConfigCacheFactory connection option.

  * Connection.setReadOnly() will take advantage of server-side
    support for read-only transactions present in MySQL 5.6 and
    newer. Calling .isReadOnly() will incur a round-trip if
    useLocalSessionState is not enabled.

  * Static charset/collation maps were updated, particularly for
    the ucs2_unicode_ci and utf8_unicode_ci collations.

  * Added support of password expiration protocol. This introduces
    a new Boolean connection property
    disconnectOnExpiredPasswords. If
    disconnectOnExpiredPasswords=true and the password has
    expired, the connection will be rejected by server with
    ErrorCode == 1820 (ER_MUST_CHANGE_PASSWORD). If
    disconnectOnExpiredPasswords=false, the connection enters
    "sandbox" mode, where all commands except SET PASSWORD = ...
    and SET PASSWORD FOR CURRENT_USER() = ... cause an error to be

  * New test cases cover new features from MySQL Server 5.6:

       + Explicit partition selection syntax.

       + EXCHANGE PARTITION syntax.

       + Transportable tablespaces syntax: LOCK TABLES ... FOR

         '/absolute/path/to/directory/' syntax for InnoDB tables.

       + New ALTER TABLE syntax: ALGORITHM and LOCK keywords.

Bugs Fixed

  * Stack trace used for point-of-origin in log and exception
    messages caused a Permgen leak when an application was
    redeployed, because the WebappClassloader could not be garbage
    collected. We no longer store the entire stack trace, only the
    calling class and method, and only when using the usage
    advisor or when profiling. (Bug #16097851, Bug #67954)

  * With the connection setting useCompression=true, the SQL
    statement LOAD DATA LOCAL INFILE could cause a error due to a broken pipe. (Bug
    #15895369, Bug #11237)

  * The nativeSQL() method would always truncate fractional
    seconds rather than preserving the fractional part in the
    output string. Now Connector/J checks the server version: it
    preserves the fractional part for MySQL 5.6.4 and greater, and
    truncates the fractional part for older versions. (Bug
    #14748459, Bug #60598)

  * With the new MySQL server password hashing feature enabled,
    different results could be returned from ResultSet and
    CachedRowSet. The test suite was modified to not perform
    comparison of PASSWORD() results when the setting
    old_passwords=2, because with SHA-256 password hashing
    enabled, the function return results are nondeterministic.
    (Bug #14665141)

  * The cleanup thread for abandoned connections in the
    NonRegisteringDriver class was refactored to have a static
    shutdown method. Memory was allocated but never released. If
    you encountered this leak problem, implement the context
    listener in your application with the
    AbandonedConnectionCleanupThread.shutdown() call in the
    contextDestroyed method. This issue was found in applications
    running under the Tomcat application server; it might have
    also applied to other application servers.
    For example:
    public class YourThreadsListener implements ServletContextListener {
       public void contextDestroyed(ServletContextEvent arg0) {
          try {
          } catch (InterruptedException e) {
    Note that if container does not support annotations, you add
    the description to web.xml:

    (Bug #14570236, Bug #65909)

  * With the connection parameter rewriteBatchedStatements=true,
    ResultSetRow.getTimeFast could give an incorrect value for
    TIME columns containing a fractional part. (Bug #14260352)

  * executeQuery() in let TRUNCATE queries be
    executed, although that method is supposed to block any
    request that modifies the database. TRUNCATE and RENAME are
    now filtered for executeQuery(). (Bug #11748257, Bug #35653)

  * If a timestamp value was passed through prepared statement
    parameters, fractional-second precision was stripped off, even
    if the underlying field (such as VARCHAR(255)) could store the
    full value. A workaround was to convert the timestamp value to
    a string when specifying the prepared statement argument, for
    example prepped_stmt.setString(1,time_stamp.toString(). This
    was partly fixed in 5.1.19, but that fix did not cover the
    case with the setting useLegacyDatetimeCode=true. (Bug
    #11750017, Bug #40279, Bug #60584)

On behalf of the MySQL/ORACLE Build Team

Hery Ramilison

Options: ReplyQuote

Written By
MySQL Connector/J 5.1.23 has been released
February 05, 2013 07:18AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.