Description:
Something in IMPORT TABLESPACE is not working correctly when using innodb_page_size=4k and ROW_FORMAT=DYNAMIC.
How to repeat:
This is simplified from innodb.innodb-wl5522-debug, which fails when using --innodb-page-size=4k and when ROW_FORMAT=DYNAMIC is made the default attribute:
--source include/not_embedded.inc
--source include/have_debug.inc
--source include/have_innodb.inc
let $MYSQLD_DATADIR =`SELECT @@datadir`;
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE=InnoDB
ROW_FORMAT=DYNAMIC;
INSERT IGNORE INTO t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 4800));
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT;
--move_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1b.ibd
--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t1b.cfg
UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE;
--move_file $MYSQLD_DATADIR/test/t1b.ibd $MYSQLD_DATADIR/test/t1.ibd
--move_file $MYSQLD_DATADIR/test/t1b.cfg $MYSQLD_DATADIR/test/t1.cfg
SET debug='+d,ib_import_trigger_corruption_3';
--error ER_NOT_KEYFILE
ALTER TABLE t1 IMPORT TABLESPACE;
SET debug='-d,ib_import_trigger_corruption_3';
DROP TABLE t1;
The last ALTER TABLE fails with the following stack trace:
#6 ut_dbg_assertion_failed (expr=0x1fbf609 "0", ...)
#7 buf_block_align (ptr=0x7feb7dd4b000 "") at buf/buf0buf.cc:3842
#8 mtr_t::memo_contains_page (memo=0x7feb7ca23b00, ptr=0x7feb7dd4b000 "", type=2) at mtr/mtr0mtr.cc:911
#9 ibuf_bitmap_page_get_bits_low (page=0x7feb7dd4b000 "", page_id=..., page_size=..., latch_type=2, mtr=0x7feb7ca23b00, bit=3) ibuf/ibuf0ibuf.cc:689
#10 ibuf_check_bitmap_on_import (trx=0x7feb8bb2dcf0, space_id=23) at ibuf/ibuf0ibuf.cc:5002
#11 row_import_for_mysql
Immediately before the assertion failure, the following messages were output:
2015-06-29T12:41:41.099709Z 3 [Note] InnoDB: Sync to disk - done!
2015-06-29T12:41:41.103030Z 3 [ERROR] InnoDB: Found a mismatch page, expect page [page id: space=23, page number=4097] but found [page id: space=0, page number=0]
Suggested fix:
Not sure. This does not seem to be directly related to replacing ROW_FORMAT=COMPACT with ROW_FORMAT=DYNAMIC.