summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/file_format_defaults.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/t/file_format_defaults.test')
-rw-r--r--mysql-test/suite/innodb/t/file_format_defaults.test76
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/file_format_defaults.test b/mysql-test/suite/innodb/t/file_format_defaults.test
new file mode 100644
index 00000000000..d276ad6e834
--- /dev/null
+++ b/mysql-test/suite/innodb/t/file_format_defaults.test
@@ -0,0 +1,76 @@
+#***********************************************************
+# 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
+
+call mtr.add_suppression("InnoDB: Cannot add field `c1` in table `test`\\.`tab0`");
+
+# 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;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
+
+SET GLOBAL innodb_file_format=Default;
+
+CREATE TABLE tab0(c1 INT,c2 LONGBLOB ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
+DROP TABLE tab0;
+
+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;