Changes in MySQL 8.0.24 (2021-04-20, General Availability)
- MySQL Enterprise Audit now supports audit log file pruning, for JSON-format log files. See Space Management of Audit Log Files.
- GCC 10 is now a supported compiler for building MySQL on EL7 or EL8. This compiler is available in the
devtoolset-10
(EL7) orgcc-toolset-10
(EL8) package. It is also recommended to use GCC 10 when building third-party applications that are based on thelibmysqlclient
C API library. (Bug #32381003)
- Previously, if a client did not use the connection to the server within the period specified by the
wait_timeout
system variable and the server closed the connection, the client received no notification of the reason. Typically, the client would see Lost connection to MySQL server during query (CR_SERVER_LOST
) or MySQL server has gone away (CR_SERVER_GONE_ERROR
).In such cases, the server now writes the reason to the connection before closing it, and client receives a more informative error message, The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior. (
ER_CLIENT_INTERACTION_TIMEOUT
).The previous behavior still applies for client connections to older servers and connections to the server by older clients.
- Client connection failure messages now include the port number. For example: Can’t connect to MySQL server on ‘127.0.0.1:63333’.. Thanks to Daniël van Eeden for the contribution. (Bug #30787660, Bug #98311)
- MySQL Keyring previously implemented keystore capabilities using server plugins, but now is transitioning to use the MySQL component infrastructure, beginning with these keyring components:
component_keyring_file
stores keyring data in a file local to the server host. This component is available in MySQL Community Edition and MySQL Enterprise Edition distributions. See Using the component_keyring_file File-Based Keyring Component.component_keyring_encrypted_file
stores keyring data in an encrypted, password-protected file local to the server host. This component is available in MySQL Enterprise Edition distributions. See Using the component_keyring_encrypted_file Encrypted File-Based Keyring Component.
The new keyring components have similarities to the existing
keyring_file
andkeyring_encrypted_file
plugins, but are configured differently, use distinct on-disk storage formats, and have fewer restrictions on key type and key size.Keyring components are not loaded using the
--early-plugin-load
server option during startup or configured during startup or at runtime using system variables:- During startup, the server determines which keyring component to load using a manifest file, and the loaded component consults its own configuration file when it initializes. See Keyring Component Installation.
- At runtime, the new
ALTER INSTANCE RELOAD KEYRING
statement enables reconfiguring an installed keyring component after changes to its configuration file. See ALTER INSTANCE Statement.
If a keyring component is installed, the new Performance Schema
keyring_component_status
table provides status information about it. See The keyring_component_status Table.Key migration capabilities have been expanded. Previously, key migration occurred only from one keyring plugin to another. The new
--keyring-migration-to-component
server option enables key migration from a keyring plugin to a keyring component; this facilitates transitioning a MySQL installation from keyring plugins to keyring components. The new mysql_migrate_keyring utility enables key migration from one keyring component to another. See Migrating Keys Between Keyring Keystores. There is no provision for migrating keys from a keyring component to a keyring plugin.Existing keyring plugins remain available with no change to user-visible characteristics, but their implementation was revised to use the component infrastructure. This is facilitated using the built-in plugin named
daemon_keyring_proxy_plugin
that acts as a bridge between the plugin and component service APIs. See The Keyring Proxy Bridge Plugin.
- The MySQL query optimizer can now apply the derived table optimization to correlated scalar subqueries. This is done by applying an extra grouping and then an outer join on the lifted predicate. For example, a query such as
SELECT * FROM t1 WHERE (SELECT a FROM t2 WHERE t2.a=t1.a) > 0
can be rewritten asSELECT t1.* FROM t1 LEFT OUTER JOIN (SELECT a, COUNT(*) AS ct FROM t2 GROUP BY a) AS derived ON t1.a = derived.a WHERE derived.a > 0
.If the subquery already has an explicit grouping, MySQL adds the extra grouping to the end of the existing grouping list.
MySQL performs a cardinality check to ensure that the subquery does not return more than one row, and raises
ER_SUBQUERY_NO_1_ROW
if it does. The check is performed as part of evaluating anyWHERE
orJOIN
clause in the rewritten query, before evaluating the lifted predicate.For more information, see Correlated Subqueries, as well as Derived Tables.