diff options
Diffstat (limited to 'mysql-test/suite/innodb/t/ibuf_not_empty.test')
-rw-r--r-- | mysql-test/suite/innodb/t/ibuf_not_empty.test | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/t/ibuf_not_empty.test b/mysql-test/suite/innodb/t/ibuf_not_empty.test index 470d375c661..33118ad6bf5 100644 --- a/mysql-test/suite/innodb/t/ibuf_not_empty.test +++ b/mysql-test/suite/innodb/t/ibuf_not_empty.test @@ -42,15 +42,43 @@ INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1; INSERT INTO t1 SELECT 0,b,c FROM t1; +let MYSQLD_DATADIR=`select @@datadir`; +let PAGE_SIZE=`select @@innodb_page_size`; + +--source include/shutdown_mysqld.inc + +# Corrupt the change buffer bitmap, to claim that pages are clean +perl; +do "$ENV{MTR_SUITE_DIR}/include/crc32.pl"; +my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd"; +open(FILE, "+<$file") || die "Unable to open $file"; +binmode FILE; +my $ps= $ENV{PAGE_SIZE}; +my $page; +sysseek(FILE, $ps, 0) || die "Unable to seek $file\n"; +die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps; +# Clean the change buffer bitmap. +substr($page,38,$ps - 38 - 8) = chr(0) x ($ps - 38 - 8); +my $polynomial = 0x82f63b78; # CRC-32C +my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^ + mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial)); +substr($page,0,4)=$ck; +substr($page,$ps-8,4)=$ck; +sysseek(FILE, $ps, 0) || die "Unable to rewind $file\n"; +syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; +close(FILE) || die "Unable to close $file"; +EOF --let $restart_parameters= --innodb-force-recovery=6 --innodb-change-buffer-dump ---source include/restart_mysqld.inc +--source include/start_mysqld.inc --replace_regex /contains \d+ entries/contains #### entries/ check table t1; --let $restart_parameters= --source include/restart_mysqld.inc +SET GLOBAL innodb_fast_shutdown=0; +--source include/restart_mysqld.inc # Cleanup DROP TABLE t1; |