mariadb/mysql-test/suite/innodb/t/file_format_defaults.test
Marko Mäkelä 8ef727b3d0 MDEV-14904 Backport innodb_default_row_format
InnoDB in Debian uses utf8mb4 as default character set since
version 10.0.20-2. This leads to major pain due to keys longer
than 767 bytes.

MariaDB 10.2 (and MySQL 5.7) introduced the setting
innodb_default_row_format that is DYNAMIC by default. These
versions also changed the default values of the parameters
innodb_large_prefix=ON and innodb_file_format=Barracuda.
This would allow longer column index prefixes to be created.
The original purpose of these parameters was to allow InnoDB
to be downgraded to MySQL 5.1, which is long out of support.

Every InnoDB version since MySQL 5.5 does support operation
with the relaxed limits.

We backport the parameter innodb_default_row_format to
MariaDB 10.1, but we will keep its default value at COMPACT.
This allows MariaDB 10.1 to be configured so that CREATE TABLE
is less likely to encounter a problem with the limitation:

	loose_innodb_large_prefix=ON
	loose_innodb_default_row_format=DYNAMIC

(Note that the setting innodb_large_prefix was deprecated in
MariaDB 10.2 and removed in MariaDB 10.3.)

The only observable difference in the behaviour with the default
settings should be that ROW_FORMAT=DYNAMIC tables can be created
both in the system tablespace and in .ibd files, no matter what
innodb_file_format has been assigned to. Unlike MariaDB 10.2,
we are not changing the default value of innodb_file_format,
so ROW_FORMAT=COMPRESSED tables cannot be created without
changing the parameter.
2018-03-07 17:49:42 +02:00

73 lines
1.9 KiB
Text

#***********************************************************
# WL#7703:
# Check the max key length 3072 when innodb_large_prefix=ON
# Check boundary value of max key length 3073
# When innodb_file_format=Antelope, compress DDLs fails
# Check file_format_max becomes Barracuda on DDL operation
# on compression table.
#***********************************************************
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
# Check some default settings
SELECT @@innodb_strict_mode;
SELECT @@innodb_file_per_table;
SET @file_format = @@GLOBAL.innodb_file_format;
SET GLOBAL innodb_large_prefix=ON;
SET SQL_MODE=strict_all_tables;
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SHOW CREATE TABLE tab0;
DROP TABLE tab0;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB KEY_BLOCK_SIZE=2;
SET GLOBAL innodb_file_format=Antelope;
# WL#8307 Make ROW_FORMAT=DYNAMIC the default
# will allow ROW_FORMAT=DYNAMIC even if innodb_file_format=Antelope.
CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
DROP TABLE tab0;
SET GLOBAL innodb_file_format=Default;
SELECT @@innodb_file_format;
SET GLOBAL innodb_strict_mode=OFF;
# Check with default value
SET GLOBAL innodb_strict_mode=Default;
SELECT @@innodb_strict_mode;
SET GLOBAL innodb_large_prefix=OFF;
SELECT @@innodb_large_prefix;
SET GLOBAL innodb_large_prefix=Default;
# Check with default value
SELECT @@innodb_large_prefix;
SET GLOBAL innodb_file_format_max=Default;
# Check with default value
SELECT @@innodb_file_format_max;
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
# Check file format changed to Barracuda, on DDL operation
SELECT @@innodb_file_format_max;
SET GLOBAL innodb_file_format_max=Default;
# Restore to the value that we explicitly used at startup.
SET GLOBAL innodb_large_prefix=off;
SET GLOBAL innodb_file_format = @file_format;
DROP TABLE tab1;