WL#7703: InnoDB: Change defaults and deprecate settings in next 5.7 release

Status: Complete

This work changes the defaults of:

innodb_strict_mode to "ON" (was: OFF). This to ensure that InnoDB returns errors rather than warnings for certain conditions.

innodb_file_format to "Barracuda" (was: Antelope). Barracuda is needed for DYNAMIC and COMPRESSED formats. Antelope formats (REDUNDANT and COMPACT) are still supported.

innodb_large_prefix to "ON" (was: OFF). This allows index key prefixes longer than 767 bytes (up to 3072 bytes) for InnoDB tables that use the DYNAMIC and COMPRESSED row formats.

The default values of the following variables will NOT be changed:

innodb_file_format_check=ON (was: ON) innodb_file_format_max=Antelope (was: Antelope)

The value of the variable innodb_file_format_max is related to innodb_file_format and DDL operations. Even if innodb_file_format=Barracuda, innodb_file_format_max will report Antelope, unless ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED is used in CREATE TABLE or ALTER TABLE statements.

We will also deprecate the following 4 parameters:

innodb_large_prefix innodb_file_format innodb_file_format_check innodb_file_format_max

If non-default startup values are used for these 4 deprecated parameters, InnoDB will issue a warning to the server error log.

We return the same deprecation and removal warning to the client when any of the 4 deprecated variables are set by the user dynamically in the running server using a SET statement.

The variable innodb_strict_mode will not be deprecated, and no warning will be issued when it is used with the SET statement.

Of the settings above, only the following have a noticeable effect on DDL behaviour:

innodb_strict_mode=ON will refuse certain CREATE TABLE and ALTER TABLE statements

Setting both innodb_file_format=Barracuda and innodb_large_prefix=ON will allow longer column prefix indexes to be created when using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED. If either of these is not set, we will silently truncate column prefixes to 768 bytes. If both are set, the maximum prefix length is about 3000 bytes, as long as the record size does not exceed half of innodb_page_size minus some framing.

The deprecation, or logging of warnings in the error log would happen in 5.7 and the removal will happen in 5.8.

Why deprecate?

The innodb_file_format family of parameters only made sense for the InnoDB Plugin in MySQL 5.1 when it was distributed separately from MySQL. Its purpose was to allow users to downgrade to the built-in InnoDB in MySQL 5.1, to avoid using incompatible format when testing the 5.1 plugin. Since MySQL 5.1, the InnoDB formats have changed without us bumping the innodb_file_format. Some examples:

5.5: New change buffer format for delete-buffering 5.6: Multiple rollback segments and undo logs; (SYS_DATAFILES and SYS_TABLESPACES tables) 5.7: R-tree indexes, changes to temporary tables, tablespace flags for CREATE TABLESPACE, new column added to SYS_INDEXES

The parameter innodb_large_prefix was introduced in MySQL 5.5, so that users could avoid accidentally creating tables that would be incompatible with the InnoDB Plugin in MySQL 5.1. Now that MySQL 5.1 is not supported any more, it makes no sense to use any other value than innodb_large_prefix=ON.

Basically, the only purpose of innodb_file_format and innodb_large_prefix is to cripple the capabilities of InnoDB. This is the reason to change the default values to ‘uncrippled’ and to deprecate and removethe parameters for future removal, so that InnoDB cannot be accidentally crippled.