Skip to content

Commit 78153cf

Browse files
committed
MDEV-11927 InnoDB change buffer is not being merged
to tables in the system tablespace This is a regression caused by MDEV-11585, which accidentally changed Tablespace::is_undo_tablespace() in an incorrect way, causing the InnoDB system tablespace to be reported as a dedicated undo tablespace, for which the change buffer is not applicable. Tablespace::is_undo_tablespace(): Remove. There were only 2 calls from the function buf_page_io_complete(). Replace those calls as appropriate. Also, merge changes to tablespace import/export tests from MySQL 5.7, and clean up the tests a little further, allowing them to be run with any innodb_page_size. Remove duplicated error injection instrumentation for the import/export tests. In MySQL 5.7, the error injection label buf_page_is_corrupt_failure was renamed to buf_page_import_corrupt_failure. fil_space_extend_must_retry(): Correct a debug assertion (tablespaces can be extended during IMPORT), and remove a TODO comment about compressed temporary tables that was already addressed in MDEV-11816. dict_build_tablespace_for_table(): Correct a comment that no longer holds after MDEV-11816, and assert that ROW_FORMAT=COMPRESSED can only be used in .ibd files.
1 parent b513e37 commit 78153cf

File tree

14 files changed

+267
-305
lines changed

14 files changed

+267
-305
lines changed

mysql-test/suite/galera/disabled.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,3 @@ galera_sst_xtrabackup-v2 : MDEV-11208
4242
galera_sst_xtrabackup-v2_encrypt_with_key : MDEV-11208
4343
mysql-wsrep#33 : TODO: investigate
4444
galera_var_innodb_disallow_writes : MDEV-10949
45-
galera_many_tables_pk : MDEV-11927
46-
galera_many_tables_nopk : MDEV-11927

mysql-test/suite/innodb/r/innodb-wl5522-debug.result

Lines changed: 53 additions & 60 deletions
Large diffs are not rendered by default.

mysql-test/suite/innodb/r/innodb-wl5522.result

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");
2+
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
23
FLUSH TABLES;
34
CREATE TABLE t1
45
(a INT AUTO_INCREMENT PRIMARY KEY,
@@ -29,15 +30,19 @@ a b c
2930
823 Evolution lsjndofiabsoibeg
3031
822 Devotion asdfuihknaskdf
3132
821 Cavalry ..asdasdfaeraf
33+
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
3234
t1.frm
3335
t1.ibd
34-
# Restarting server
35-
# Done restarting server
36-
FLUSH TABLE t1 FOR EXPORT;
36+
t2.frm
37+
t2.ibd
38+
FLUSH TABLE t1, t2 FOR EXPORT;
3739
# List before copying files
3840
t1.cfg
3941
t1.frm
4042
t1.ibd
43+
t2.cfg
44+
t2.frm
45+
t2.ibd
4146
UNLOCK TABLES;
4247
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
4348
SELECT COUNT(*) FROM t1;
@@ -58,9 +63,13 @@ a b c
5863
# List before t1 DISCARD
5964
t1.frm
6065
t1.ibd
66+
t2.frm
67+
t2.ibd
6168
ALTER TABLE t1 DISCARD TABLESPACE;
6269
# List after t1 DISCARD
6370
t1.frm
71+
t2.frm
72+
t2.ibd
6473
ALTER TABLE t1 IMPORT TABLESPACE;
6574
ALTER TABLE t1 ENGINE InnoDB;
6675
SELECT COUNT(*) FROM t1;
@@ -79,6 +88,8 @@ a b c
7988
t1.cfg
8089
t1.frm
8190
t1.ibd
91+
t2.frm
92+
t2.ibd
8293
SELECT COUNT(*) FROM t1;
8394
COUNT(*)
8495
640
@@ -93,6 +104,19 @@ a b c
93104
822 Devotion asdfuihknaskdf
94105
821 Cavalry ..asdasdfaeraf
95106
DROP TABLE t1;
107+
ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
108+
ALTER TABLE t2 DISCARD TABLESPACE;
109+
# List after t2 DISCARD
110+
t2.frm
111+
ALTER TABLE t2 IMPORT TABLESPACE;
112+
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x4 and the meta-data file has 0x1)
113+
ALTER TABLE t2 IMPORT TABLESPACE;
114+
ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
115+
DROP TABLE t2;
116+
SET GLOBAL innodb_file_per_table = 1;
117+
SELECT @@innodb_file_per_table;
118+
@@innodb_file_per_table
119+
1
96120
CREATE TABLE t1(
97121
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
98122
c2 INT) ENGINE=InnoDB;

0 commit comments

Comments
 (0)