summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-03-07 12:07:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-03-07 17:49:42 +0200
commit8ef727b3d072c13788553f2174fd8bd70481f658 (patch)
treed00ce30faab9f1fdfbaf08c26b210f6ac07b2fed /mysql-test/suite/sys_vars
parent176d603cc7f2be0f5816a28c738cdd52ff6e3008 (diff)
downloadmariadb-git-8ef727b3d072c13788553f2174fd8bd70481f658.tar.gz
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.
Diffstat (limited to 'mysql-test/suite/sys_vars')
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result14
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test41
3 files changed, 103 insertions, 0 deletions
diff --git a/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result
new file mode 100644
index 00000000000..971b8b9d243
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result
@@ -0,0 +1,48 @@
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 'redundant';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+redundant
+SET GLOBAL innodb_default_row_format = 'dynamic';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 'compact';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 'compressed';
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of 'compressed'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 'foobar';
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of 'foobar'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 0;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+redundant
+SET GLOBAL innodb_default_row_format = 1;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 2;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 3;
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of '3'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 123;
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of '123'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = default;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 161f740dbfb..fd33338cbc8 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -635,6 +635,20 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEFAULT_ROW_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE compact
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE compact
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT The default ROW FORMAT for all innodb tables created without explicit ROW_FORMAT. Possible values are REDUNDANT, COMPACT, and DYNAMIC. The ROW_FORMAT value COMPRESSED is not allowed
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST redundant,compact,dynamic
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DEFRAGMENT
SESSION_VALUE NULL
GLOBAL_VALUE OFF
diff --git a/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test b/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test
new file mode 100644
index 00000000000..f9aabf49ba4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test
@@ -0,0 +1,41 @@
+--source include/have_innodb.inc
+
+# Check the default value
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'redundant';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'dynamic';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'compact';
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 'compressed';
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 'foobar';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 0;
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 1;
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 2;
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 3;
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 123;
+SELECT @@global.innodb_default_row_format;
+
+
+SET GLOBAL innodb_default_row_format = default;