This section summarizes what has been added to, deprecated in, and removed from MySQL 8.1 as compared to MySQL 8.0. A companion section lists MySQL server options and variables that have been added, deprecated, or removed in MySQL 8.1; see Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 8.1”.
The following features not found in MySQL 8.0 were added to MySQL 8.1:
Capturing EXPLAIN FORMAT=JSON output. The 8.1 release extended
EXPLAIN FORMAT=JSON
with anINTO
option, which provides the ability to store JSON-formattedEXPLAIN
output in a user variable where it can be worked with using MySQL JSON functions, like this:mysql> EXPLAIN FORMAT=JSON INTO @myex SELECT name FROM a WHERE id = 2; Query OK, 0 rows affected (0.00 sec) mysql> SELECT JSON_EXTRACT(@myex, "$.query_block.table.key"); +------------------------------------------------+ | JSON_EXTRACT(@myex, "$.query_block.table.key") | +------------------------------------------------+ | "PRIMARY" | +------------------------------------------------+ 1 row in set (0.01 sec)
This option can be used only if the
EXPLAIN
statement also containsFORMAT=JSON
; otherwise, a syntax error results. This requirement is not affected by the value ofexplain_format
.INTO
can be used with any explainable statement with the exception ofEXPLAIN FOR CONNECTION
. It cannot be used withEXPLAIN ANALYZE
.For more information and examples, see Obtaining Execution Plan Information.
Client comments preserved. In MySQL 8.0, the stripping of comments from the mysql client was the default behavior; in MySQL 8.1, the default was changed to preserving such comments.
To enable the stripping of comments as was performed in MySQL 8.0 and earlier, start the mysql client with
--skip-comments
.MySQL Replication: SOURCE_RETRY_COUNT change. The default value for the
SOURCE_RETRY_COUNT
option of theCHANGE REPLICATION SOURCE TO
statement was changed to 10. This means that, using the default values for this option and forSOURCE_CONNECT_RETRY
(60), the replica waits 60 seconds between reconnection attempts, and keeps attempting to reconnect at this rate for 10 minutes before timing out and failing over.This change also applies to the default value of the deprecated
--master-retry-count
server option. (You should useSOURCE_RETRY_COUNT
, instead.)For more information, see Section 17.4.9.1, “Asynchronous Connection Failover for Sources”.
group_replication_set_as_primary() and DDL statements. The
group_replication_set_as_primary()
function waits for ongoing DDL statements such asALTER TABLE
when waiting for all transactions to complete, prior to electing a new primary.For more information, see the description of this function.
The MySQL version number used in version-specific comments supports a major version consisting of one or two digits; this means that the entire version can be either five or six digits long. For more information about how this change affects handling of versioned comments in MySQL, see Section 9.7, “Comments”.
Logging of the shutdown process was enhanced, with the addition of startup and shutdown messages for the MySQL server, plugins, and components. Such messages are now also logged for closing connections. These additions should facilitate troubleshooting and debugging problems, particularly in the event that the server takes an excessively long time to shut down.
For more information, see Section 5.4.2, “The Error Log”.
Added the
SHOW PARSE_TREE
statement, which shows the JSON-formatted parse tree for aSELECT
statement. This statement is intended for testing and development use only, and not in production. It is available only in debug builds, or if MySQL was built from source using the CMake-DWITH_SHOW_PARSE_TREE
option, and is not included or supported in release builds.Added the
tls-certificates-enforced-validation
system variable, which permits a DBA to enforce certificate validation at server startup or when using theALTER INSTANCE RELOAD TLS
statement to reload certificates at runtime. With enforcement enabled, discovering an invalid certificate halts server invocation at startup, prevents loading invalid certificates at runtime, and emits warnings. For more information, see Configuring Certificate Validation Enforcement.Added a number of status variables specific to the Group Replication plugin that improve diagnosis and troubleshooting of network instabilities, providing statistics about network usage, control messages, and data messages for each group member.
See Section 18.9.2, “Group Replication Status Variables”, for more information.
As part of this work, a new
MEMBER_FAILURE_SUSPICIONS_COUNT
column was added to the Performance Schemareplication_group_communication_information
table. The contents of this column are formatted as a JSON array whose keys are group members ID and whose values are the number of times the group member has been considered suspect. See the description of this table for more information.Added server system variables to control the amount of time MySQL accounts that connect to a MySQL server using LDAP pluggable authentication must wait when the LDAP server is down or unresponsive. The default timeout became 30 seconds for the following simple and SASL-based LDAP authentication variables:
Connection and response timeouts are configurable through the system variables on Linux platforms only. For more information, see Setting Timeouts for LDAP Pluggable Authentication.
The following features were deprecated in MySQL 8.1 and may be removed in a future series. Where alternatives are shown, applications should be updated to use them.
For applications that use features deprecated in MySQL 8.1 that have been removed in a higher MySQL series, statements may fail when replicated from a MySQL 8.1 source to a replica using a later version, or may have different effects on source and replica. To avoid such problems, applications that use deprecated features should be revised to avoid them and use alternatives when possible.
Deprecations in 8.0.34 and 8.1.0. Features deprecated in both 8.0.34 and 8.1.0 are documented in the MySQL 8.0 manual. See MySQL 8.0 Deprecations.
The following items are obsolete and were removed in MySQL 8.1. Where alternatives are shown, applications should be updated to use them.
For MySQL 8.0 applications that use features removed in MySQL 8.1 or later, statements may fail when replicated from a MySQL 8.0 source to a replica running MySQL 8.1 or later, or may have different effects on source and replica. To avoid such problems, applications that use such removed features should be revised to avoid them and use alternatives when possible.
System variables and NULL. It is not intended or supported for a MySQL server startup option to be set to NULL (
--my-option=NULL
) and have it interpreted by the server as SQLNULL
, and should not be possible. MySQL 8.1 (and later) specifically disallows setting startup options toNULL
in this fashion, and rejects an attempt to do with an error. Attempts to set the corresponding server system variables toNULL
usingSET
or similar in the mysql client are also rejected.The server system variables in the following list are excepted from the restriction just described:
See also Section 5.1.8, “Server System Variables”.
Identifiers with an initial dollar sign. The use of the dollar sign (
$
) as the initial character of an unquoted identifier was deprecated in MySQL 8.0, and is restricted in MySQL 8.1 and later; using an unquoted identifier beginning with a dollar sign and containing one or more dollar signs (in addition to the first one) now generates a syntax error.Unquoted identifiers starting with
$
are not affected by this restriction if they do not contain any additional$
characters.