summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-06-13 18:29:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-06-13 18:30:37 +0300
commit9ed325efc17e78f4c98d923c2af92c8b18cec0c5 (patch)
treea681ea7ee7ea10f87a3d62cf2959c7bbe8471f5d
parent9f0ed6c67e96e9b7fa4222c2c36640c0f691f43d (diff)
parent1d5a306e3884ff0b159402f1f83dee2fb87d93f4 (diff)
downloadmariadb-git-9ed325efc17e78f4c98d923c2af92c8b18cec0c5.tar.gz
Merge 10.0 into 10.1, plus fixup for MDEV-12873
Cover innodb.table_flags with the new innodb_page_size.combinations 32k and 64k. dict_sys_tables_type_validate(): Remove an assertion that made a check in the function redundant. Remove the excessive output to the error log, as the invalid SYS_TABLES.TYPE value is already being output.
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k.rdiff96
-rw-r--r--mysql-test/suite/innodb/r/table_flags,4k.rdiff83
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k.rdiff96
-rw-r--r--mysql-test/suite/innodb/r/table_flags,8k.rdiff83
-rw-r--r--mysql-test/suite/innodb/r/table_flags.result173
-rw-r--r--mysql-test/suite/innodb/t/row_format_redundant.test14
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test188
-rw-r--r--storage/innobase/include/dict0dict.ic20
-rw-r--r--storage/xtradb/include/dict0dict.ic20
-rw-r--r--storage/xtradb/os/os0file.cc2
10 files changed, 723 insertions, 52 deletions
diff --git a/mysql-test/suite/innodb/r/table_flags,32k.rdiff b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
new file mode 100644
index 00000000000..a6665e85f49
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
@@ -0,0 +1,96 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,32k.reject
+@@ -4,6 +4,8 @@
+ CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=COMPACT.
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+@@ -11,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000001310194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -21,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x800000012c0110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -31,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x800000012c0201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -41,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000001310110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -51,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x83000001350110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -61,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x84000001360110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -71,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x86000001380110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+@@ -81,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x82000001340110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -91,10 +93,10 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x85000001370110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,4k.rdiff b/mysql-test/suite/innodb/r/table_flags,4k.rdiff
new file mode 100644
index 00000000000..faa8a408c65
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,4k.rdiff
@@ -0,0 +1,83 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,4k.reject
+@@ -13,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000003260194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -23,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x80000003200110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -33,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x80000003200201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -43,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000003260110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -53,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x830000032b0110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -63,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x840000032c0110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -73,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x860000032e0110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -83,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x820000032a0110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -93,7 +93,7 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x850000032d0110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags,64k.rdiff b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
new file mode 100644
index 00000000000..76cb6005780
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
@@ -0,0 +1,96 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,64k.reject
+@@ -4,6 +4,8 @@
+ CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=COMPACT.
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+@@ -11,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000001310194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -21,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x800000012c0110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -31,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x800000012c0201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -41,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000001310110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -51,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x83000001350110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -61,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x84000001360110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -71,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x86000001380110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+@@ -81,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x82000001340110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -91,10 +93,10 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x85000001370110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,8k.rdiff b/mysql-test/suite/innodb/r/table_flags,8k.rdiff
new file mode 100644
index 00000000000..ba3439fc6cf
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,8k.rdiff
@@ -0,0 +1,83 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,8k.reject
+@@ -13,7 +13,7 @@
+ header=0x01000003016e (NAME=0x696e66696d756d00)
+ header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320194,
++ DB_ROLL_PTR=0x81000001d70194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+@@ -23,7 +23,7 @@
+ SPACE=0x00000000)
+ header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0110,
++ DB_ROLL_PTR=0x80000001d10110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -33,7 +33,7 @@
+ SPACE=0x00000000)
+ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+- DB_ROLL_PTR=0x800000012d0201,
++ DB_ROLL_PTR=0x80000001d10201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+@@ -43,7 +43,7 @@
+ SPACE=0x00000000)
+ header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+- DB_ROLL_PTR=0x81000001320110,
++ DB_ROLL_PTR=0x81000001d70110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+@@ -53,7 +53,7 @@
+ SPACE=0x00000000)
+ header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+- DB_ROLL_PTR=0x83000001360110,
++ DB_ROLL_PTR=0x83000001db0110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+@@ -63,7 +63,7 @@
+ SPACE=0x00000002)
+ header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+- DB_ROLL_PTR=0x84000001370110,
++ DB_ROLL_PTR=0x84000001dc0110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -73,7 +73,7 @@
+ SPACE=0x00000003)
+ header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+- DB_ROLL_PTR=0x86000001390110,
++ DB_ROLL_PTR=0x86000001de0110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+@@ -83,7 +83,7 @@
+ SPACE=0x00000005)
+ header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+- DB_ROLL_PTR=0x82000001350110,
++ DB_ROLL_PTR=0x82000001da0110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+@@ -93,7 +93,7 @@
+ SPACE=0x00000001)
+ header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+- DB_ROLL_PTR=0x85000001380110,
++ DB_ROLL_PTR=0x85000001dd0110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000023,
diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result
new file mode 100644
index 00000000000..f926e27778e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags.result
@@ -0,0 +1,173 @@
+SET GLOBAL innodb_file_per_table=1;
+CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+SYS_TABLES clustered index root page (8):
+N_RECS=9; LEVEL=0; INDEX_ID=0x0000000000000001
+header=0x01000003016e (NAME=0x696e66696d756d00)
+header=0x00002815008d (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000301,
+ DB_ROLL_PTR=0x81000001320194,
+ ID=0x000000000000000e,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+header=0x0000101500d5 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000300,
+ DB_ROLL_PTR=0x800000012d0110,
+ ID=0x000000000000000b,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000300,
+ DB_ROLL_PTR=0x800000012d0201,
+ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+header=0x0400201501fc (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000301,
+ DB_ROLL_PTR=0x81000001320110,
+ ID=0x000000000000000d,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+header=0x000038150240 (NAME='test/tc',
+ DB_TRX_ID=0x000000000303,
+ DB_ROLL_PTR=0x83000001360110,
+ ID=0x0000000000000010,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000002)
+header=0x0000401502c8 (NAME='test/td',
+ DB_TRX_ID=0x000000000304,
+ DB_ROLL_PTR=0x84000001370110,
+ ID=0x0000000000000011,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000003)
+header=0x0000501501b8 (NAME='test/tp',
+ DB_TRX_ID=0x000000000306,
+ DB_ROLL_PTR=0x86000001390110,
+ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000005)
+header=0x000030150284 (NAME='test/tr',
+ DB_TRX_ID=0x000000000302,
+ DB_ROLL_PTR=0x82000001350110,
+ ID=0x000000000000000f,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000001)
+header=0x000048150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000305,
+ DB_ROLL_PTR=0x85000001380110,
+ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000023,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000004)
+header=0x060008030000 (NAME=0x73757072656d756d00)
+SHOW CREATE TABLE tr;
+Table Create Table
+tr CREATE TABLE `tr` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+INSERT INTO tr VALUES(42);
+SHOW CREATE TABLE tc;
+ERROR 42S02: Table 'test.tc' doesn't exist in engine
+SHOW CREATE TABLE td;
+ERROR 42S02: Table 'test.td' doesn't exist in engine
+SHOW CREATE TABLE tz;
+ERROR 42S02: Table 'test.tz' doesn't exist in engine
+SHOW CREATE TABLE tp;
+ERROR 42S02: Table 'test.tp' doesn't exist in engine
+FOUND /InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\b/ in mysqld.1.err
+FOUND /InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB/ in mysqld.1.err
+Restoring SYS_TABLES clustered index root page (8)
+SHOW CREATE TABLE tr;
+Table Create Table
+tr CREATE TABLE `tr` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+SHOW CREATE TABLE tc;
+Table Create Table
+tc CREATE TABLE `tc` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+SHOW CREATE TABLE td;
+Table Create Table
+td CREATE TABLE `td` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+SHOW CREATE TABLE tz;
+Table Create Table
+tz CREATE TABLE `tz` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1
+SHOW CREATE TABLE tp;
+Table Create Table
+tp CREATE TABLE `tp` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9
+BEGIN;
+INSERT INTO tr VALUES(1);
+INSERT INTO tc VALUES(1);
+INSERT INTO td VALUES(1);
+INSERT INTO tz VALUES(1);
+INSERT INTO tp VALUES(1);
+ROLLBACK;
+SELECT * FROM tr;
+a
+42
+SELECT * FROM tc;
+a
+SELECT * FROM td;
+a
+SELECT * FROM tz;
+a
+SELECT * FROM tp;
+a
+DROP TABLE tr,tc,td,tz,tp;
+ib_logfile0
+ib_logfile1
+ibdata1
+sys_tables.bin
diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test
index 974588d11eb..d10121c75c6 100644
--- a/mysql-test/suite/innodb/t/row_format_redundant.test
+++ b/mysql-test/suite/innodb/t/row_format_redundant.test
@@ -1,17 +1,7 @@
---source include/innodb_page_size.inc
+--source include/have_innodb.inc
# Embedded mode doesn't allow restarting
--source include/not_embedded.inc
-# MDEV-13059 XtraDB hangs on Windows due to failing to release
-# block->lock X-latch in innodb_read_only mode
-if (`SELECT count(*) FROM information_schema.plugins WHERE
- plugin_name = 'innodb' AND plugin_status = 'active' AND
- plugin_description LIKE '%xtradb%'`){
- if (`SELECT @@version_compile_os IN ('Win32','Win64','Windows')`) {
- skip MDEV-13059 XtraDB hangs on Windows in innodb_read_only mode;
- }
-}
-
create table t1 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156),
fulltext ftsic(c)) engine=InnoDB
@@ -70,6 +60,4 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
-# TODO: Shutdown, corrupt the SYS_TABLES.TYPE of the tables, restart
-
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
new file mode 100644
index 00000000000..1e2b22235a2
--- /dev/null
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -0,0 +1,188 @@
+--source include/innodb_page_size.inc
+# Embedded server tests do not support restarting
+--source include/not_embedded.inc
+
+--disable_query_log
+call mtr.add_suppression("InnoDB: New log files created, LSN=");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+call mtr.add_suppression("InnoDB: Error: .*innodb_table_stats. not found");
+call mtr.add_suppression("InnoDB: Table '.test.\\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\\r?$");
+call mtr.add_suppression("InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB");
+call mtr.add_suppression("InnoDB: Error: table 'test/t[cdzp]'");
+FLUSH TABLES;
+--enable_query_log
+
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+let MYSQLD_DATADIR=`select @@datadir`;
+
+let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags;
+--mkdir $bugdir
+--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
+
+--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
+--let $d=$d --innodb-data-file-path=ibdata1:10M:autoextend
+--let $d=$d --innodb-undo-tablespaces=0
+--let $restart_parameters=$d --innodb-stats-persistent=0 --innodb-file-format=1
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_per_table=1;
+CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT;
+CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+# PAGE_COMPRESSED is supported starting with MariaDB 10.1.0
+CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+
+--source include/shutdown_mysqld.inc
+--perl
+use strict;
+my $ps= $ENV{INNODB_PAGE_SIZE};
+my $file= "$ENV{bugdir}/ibdata1";
+open(FILE, "+<", $file) || die "Unable to open $file\n";
+# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME).
+sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file";
+die "Unable to read $file" unless sysread(FILE, $_, 4) == 4;
+my $sys_tables_root = unpack("N", $_);
+my $page;
+print "SYS_TABLES clustered index root page ($sys_tables_root):\n";
+sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file";
+die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+open(BACKUP, ">$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n";
+syswrite(BACKUP, $page, $ps)==$ps || die "Unable to write backup\n";
+close(BACKUP) || die "Unable to close backup\n";
+print "N_RECS=", unpack("n", substr($page,38+16,2));
+print "; LEVEL=", unpack("n", substr($page,38+26,2));
+print "; INDEX_ID=0x", unpack("H*", substr($page,38+28,8)), "\n";
+my @fields=("NAME","DB_TRX_ID","DB_ROLL_PTR",
+ "ID","N_COLS","TYPE","MIX_ID","MIX_LEN","CLUSTER_NAME","SPACE");
+for (my $offset= 0x65; $offset;
+ $offset= unpack("n", substr($page,$offset-2,2)))
+{
+ print "header=0x", unpack("H*",substr($page,$offset-6,6)), " (";
+ my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff;
+ my $start= 0;
+ my $name;
+ for (my $i= 0; $i < $n_fields; $i++) {
+ my $end= unpack("C", substr($page, $offset-7-$i, 1));
+ print ",\n " if $i;
+ print "$fields[$i]=";
+ if ($end & 0x80) {
+ print "NULL(", ($end & 0x7f) - $start, " bytes)"
+ } elsif ($n_fields > 1 && $i == 0) {
+ $name= substr($page,$offset+$start,$end-$start);
+ print "'$name'"
+ } else {
+ print "0x", unpack("H*", substr($page,$offset+$start,$end-$start))
+ }
+ # Corrupt SYS_TABLES.TYPE
+ if ($i == 5)
+ {
+ my $flags= 0;
+ if ($name eq 'test/tr') {
+ $flags= 0x40 # DATA_DIR (largely ignored by 10.1+)
+ } elsif ($name eq 'test/tc') {
+ $flags= 0x80 # 10.1 PAGE_COMPRESSED
+ } elsif ($name eq 'test/td') {
+ $flags= 0xf00 # 10.1 PAGE_COMPRESSION_LEVEL=15 (0..9 is valid)
+ } elsif ($name eq 'test/tz') {
+ $flags= 0x3000 # 10.1 ATOMIC_WRITES=3 (0..2 is valid)
+ } elsif ($name eq 'test/tp') {
+ $flags= 0x880 # 10.1 PAGE_COMPRESSED, PAGE_COMPRESSION_LEVEL=8
+ # (in 10.1, this leaves PAGE_COMPRESSION_LEVEL=1
+ # without PAGE_COMPRESSED, which should be invalid)
+ }
+
+ substr($page,$offset+$start,$end-$start)= pack(
+ "N", $flags ^
+ unpack("N", substr($page,$offset+$start,$end-$start)))
+ if $flags;
+ }
+ # Corrupt SYS_TABLES.MIX_LEN (ignored for ROW_FORMAT=REDUNDANT)
+ if ($i == 7 && $name eq 'test/tr')
+ {
+ substr($page,$offset+$start,$end-$start)= chr(255) x 4;
+ }
+ $start= $end & 0x7f;
+ }
+ print ")\n";
+}
+substr($page,0,4)=pack("N",0xdeadbeef);
+substr($page,$ps-8,4)=pack("N",0xdeadbeef);
+sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file";
+syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
+close(FILE) || die "Unable to close $file\n";
+EOF
+--source include/start_mysqld.inc
+
+SHOW CREATE TABLE tr;
+INSERT INTO tr VALUES(42);
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+SHOW CREATE TABLE tc;
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+SHOW CREATE TABLE td;
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+SHOW CREATE TABLE tz;
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+SHOW CREATE TABLE tp;
+
+--source include/shutdown_mysqld.inc
+
+let SEARCH_RANGE= -50000;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--let SEARCH_PATTERN= InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|121|302[13])\b
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB
+--source include/search_pattern_in_file.inc
+
+# Restore the backup of the corrupted SYS_TABLES clustered index root page
+--perl
+use strict;
+my $ps= $ENV{INNODB_PAGE_SIZE};
+my $file= "$ENV{bugdir}/ibdata1";
+open(FILE, "+<", $file) || die "Unable to open $file\n";
+open(BACKUP, "<$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n";
+# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME).
+sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file";
+die "Unable to read $file\n" unless sysread(FILE, $_, 4) == 4;
+my $sys_tables_root = unpack("N", $_);
+print "Restoring SYS_TABLES clustered index root page ($sys_tables_root)\n";
+sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file";
+die "Unable to read backup\n" unless sysread(BACKUP, $_, $ps) == $ps;
+die "Unable to restore backup\n" unless syswrite(FILE, $_, $ps) == $ps;
+close(BACKUP);
+close(FILE) || die "Unable to close $file\n";
+EOF
+--source include/start_mysqld.inc
+
+SHOW CREATE TABLE tr;
+SHOW CREATE TABLE tc;
+SHOW CREATE TABLE td;
+SHOW CREATE TABLE tz;
+SHOW CREATE TABLE tp;
+
+BEGIN;
+INSERT INTO tr VALUES(1);
+INSERT INTO tc VALUES(1);
+INSERT INTO td VALUES(1);
+INSERT INTO tz VALUES(1);
+INSERT INTO tp VALUES(1);
+ROLLBACK;
+
+SELECT * FROM tr;
+SELECT * FROM tc;
+SELECT * FROM td;
+SELECT * FROM tz;
+SELECT * FROM tp;
+
+DROP TABLE tr,tc,td,tz,tp;
+
+--source include/shutdown_mysqld.inc
+
+--let $restart_parameters=
+--source include/start_mysqld.inc
+
+--list_files $bugdir
+--remove_files_wildcard $bugdir
+--rmdir $bugdir
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index efdd814e3d6..6044f992d82 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -705,8 +705,6 @@ dict_sys_tables_type_validate(
ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(type);
ulint atomic_writes = DICT_TF_GET_ATOMIC_WRITES(type);
- ut_a(atomic_writes <= ATOMIC_WRITES_OFF);
-
/* The low order bit of SYS_TABLES.TYPE is always set to 1.
If the format is UNIV_FORMAT_B or higher, this field is the same
as dict_table_t::flags. Zero is not allowed here. */
@@ -716,16 +714,12 @@ dict_sys_tables_type_validate(
if (redundant) {
if (zip_ssize || atomic_blobs) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
- zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Make sure there are no bits that we do not know about. */
if (unused) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", unused " ULINTPF "\n",
- type, unused);
return(ULINT_UNDEFINED);
}
@@ -737,11 +731,8 @@ dict_sys_tables_type_validate(
The DICT_N_COLS_COMPACT flag should be in N_COLS,
but we already know that. */
-
} else if (zip_ssize) {
/* Antelope does not support COMPRESSED format. */
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF "\n",
- type, zip_ssize);
return(ULINT_UNDEFINED);
}
@@ -751,15 +742,11 @@ dict_sys_tables_type_validate(
should be in N_COLS, but we already know about the
low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
- type, zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED);
}
/* Validate that the number is within allowed range. */
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " max %d\n",
- type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
return(ULINT_UNDEFINED);
}
}
@@ -776,18 +763,13 @@ dict_sys_tables_type_validate(
low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs || !page_compression) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", page_compression " ULINTPF " page_compression_level " ULINTPF "\n"
- "InnoDB: Error: atomic_blobs " ULINTPF "\n",
- type, page_compression, page_compression_level, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Validate that the atomic writes number is within allowed range. */
if (atomic_writes > ATOMIC_WRITES_OFF) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", atomic_writes " ULINTPF "\n",
- type, atomic_writes);
- return(ULINT_UNDEFINED);
+ return(ULINT_UNDEFINED);
}
/* Return the validated SYS_TABLES.TYPE. */
diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic
index 4ed1afc8094..f68d4e176da 100644
--- a/storage/xtradb/include/dict0dict.ic
+++ b/storage/xtradb/include/dict0dict.ic
@@ -705,8 +705,6 @@ dict_sys_tables_type_validate(
ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(type);
ulint atomic_writes = DICT_TF_GET_ATOMIC_WRITES(type);
- ut_a(atomic_writes <= ATOMIC_WRITES_OFF);
-
/* The low order bit of SYS_TABLES.TYPE is always set to 1.
If the format is UNIV_FORMAT_B or higher, this field is the same
as dict_table_t::flags. Zero is not allowed here. */
@@ -716,16 +714,12 @@ dict_sys_tables_type_validate(
if (redundant) {
if (zip_ssize || atomic_blobs) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
- zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Make sure there are no bits that we do not know about. */
if (unused) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", unused " ULINTPF "\n",
- type, unused);
return(ULINT_UNDEFINED);
}
@@ -737,11 +731,8 @@ dict_sys_tables_type_validate(
The DICT_N_COLS_COMPACT flag should be in N_COLS,
but we already know that. */
-
} else if (zip_ssize) {
/* Antelope does not support COMPRESSED format. */
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF "\n",
- type, zip_ssize);
return(ULINT_UNDEFINED);
}
@@ -751,15 +742,11 @@ dict_sys_tables_type_validate(
should be in N_COLS, but we already know about the
low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
- type, zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED);
}
/* Validate that the number is within allowed range. */
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " max %d\n",
- type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
return(ULINT_UNDEFINED);
}
}
@@ -776,18 +763,13 @@ dict_sys_tables_type_validate(
low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs || !page_compression) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", page_compression " ULINTPF " page_compression_level " ULINTPF "\n"
- "InnoDB: Error: atomic_blobs " ULINTPF "\n",
- type, page_compression, page_compression_level, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Validate that the atomic writes number is within allowed range. */
if (atomic_writes > ATOMIC_WRITES_OFF) {
- fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", atomic_writes " ULINTPF "\n",
- type, atomic_writes);
- return(ULINT_UNDEFINED);
+ return(ULINT_UNDEFINED);
}
/* Return the validated SYS_TABLES.TYPE. */
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index 20b202506f5..7fbee0312ee 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -4401,7 +4401,7 @@ os_aio_init(
#ifdef _WIN32
ut_a(completion_port == 0 && read_completion_port == 0);
completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
- read_completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
+ read_completion_port = srv_read_only_mode? completion_port : CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
ut_a(completion_port && read_completion_port);
#endif