diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-25 17:09:56 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-25 17:09:56 +0200 |
commit | fe03d35b367ac047b5cafc50f0b98624658c4aec (patch) | |
tree | 5614bd0b32e2f7da10ea2dbcd6f4afc83ba0d130 /mysql-test/suite/innodb | |
parent | 524221e7a34d42214e82dd868348b453f2ef1591 (diff) | |
download | mariadb-git-bb-10.1-MDEV-13103.tar.gz |
MDEV-13103: InnoDB crash recovery fails to decompress a page in buf_dblwr_process()bb-10.1-MDEV-13103
There were several problems. Firstly, page decompression code did not handle
possible decompression errors correctly. Secondly, not all compression methods
tolerate corrupted input (e.g. lz4 did not tolerate input that was compressed
using snappy method). Finally, if page is actually also encrypted we can't
decompress page. Solutions: Add proper error handling to decompression code
and add post compression checksum to page. As whole page including page checksum
is compressed we can reuse the original checksum field for post compression
checksum. With post compression checksum we can detect most of the corruptions.
If no corruption is detected hopefully decompression code can detect
remaining problems.
Doublewrite buffer page recovery for page compressed pages require
that post compression checksum matches. For pages from old releases
supporting page compression checksum must be BUF_NO_CHECKSUM_MAGIC.
Upgrade from older versions is supported as post compression
checksum check accepts the BUF_NO_CHECKSUM_MAGIC that they stored
in checksum filed.
Downgrade to older versions is not supported (assuming that there
were some changes to compressed tables) as page compression code
would not tolerate any other checksum except BUF_NO_CHECKSUM_MAGIC.
innochecksum.cc is_page_corrupted:
If page is compressed verify post compression checksum
buf_page_decrypt_after_read
Return DB_PAGE_CORRUPTED if page is found to be corrupted
after post compression checksum check.
buf_page_io_complete
If page is found corrupted after buf_page_decrypt_after_read
there is no need to continue page check.
buf_page_decrypt_after_read
Verify post compression checksum before decompression and
if it does not match mark page corrupted. Note that old
compressed pages do not really have post compression
checksum so they are treated as not corrupted and then
we need to hope that decompression code can handle the
possible corruptions by returning error.
buf_calc_compressed_crc32
New function to calculate post compression checksum
so that necessary compression metadata fields are
included.
buf_dblwr_decompress
New function that handles post compression checksum check
and page decompression if it is ok.
buf_dblwr_process
Verify post compression checksum before trying to decompress
page.
fil_space_verify_crypt_checksum
Remove incorrect code as compressed and encrypted pages
do have post encryption checksum.
fil_compress_page
Calculate and store post compression checksum to FIL_SPACE_OR_CHKSUM
field as original value is stored on compressed image.
fil_decompress_page
Add error handling if decompression fails.
fil_verify_compression_checksum
New function to verify post compression checksum.
Compressed tablespaces before this change have BUF_NO_CHECKSUM_MAGIC
in checksum field and they must be treated as not corrupted.
convert_error_code_to_mysql
Handle also page corruptions DB_PAGE_CORRUPTED as HA_ERR_CRASHED.
Note that there are cases when we do not know for certain
is page corrupted, corrupted and compressed, or still encrypted
after failed decrypt, thus tablespace could be marked just corrupted.
Tests modified
innodb-page_compression_[zip, lz4, lzma, lzo, bzip2, snappy]
to use innodb-page-compression.inc
innodb-page-compression.inc add innochecksum and intentional tablespace
corruption tests.
innodb-force-corrupt, innodb_bug14147491 add new error
messages to mtr suppression and new error codes.
New tests
encryption/innodb-corrupted.test test intentionally corrupted
tablespaces containing encryption and compression.
doublewrite-compressed test doublewrite recovery for page
compressed tables
innodb-import-101 import files from both big_endian and little_endian
machine
This is 10.1 version use null merge to 10.2 as it has its own version.
Diffstat (limited to 'mysql-test/suite/innodb')
18 files changed, 1870 insertions, 757 deletions
diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc index 3acbeaf0988..8a0036d61e0 100644 --- a/mysql-test/suite/innodb/include/innodb-page-compression.inc +++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc @@ -1,53 +1,63 @@ +if (!$INNOCHECKSUM) { + --echo Need innochecksum binary + --die Need innochecksum binary +} + --disable_warnings set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; --enable_warnings -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); + +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; --disable_query_log begin; -let $i = 2000; +let $i = 100; while ($i) { - insert into innodb_normal(b) values(REPEAT('Aa',50)); - insert into innodb_normal(b) values(REPEAT('a',100)); - insert into innodb_normal(b) values(REPEAT('b',100)); - insert into innodb_normal(b) values(REPEAT('0',100)); - insert into innodb_normal(b) values(REPEAT('1',100)); + insert into t0(b) values(REPEAT('Aa',50)); + insert into t0(b) values(REPEAT('a',100)); + insert into t0(b) values(REPEAT('b',100)); + insert into t0(b) values(REPEAT('0',100)); + insert into t0(b) values(REPEAT('1',100)); dec $i; } -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; +insert into t1 select * from t0; +insert into t2 select * from t0; +insert into t3 select * from t0; +insert into t4 select * from t0; +insert into t5 select * from t0; +insert into t6 select * from t0; +insert into t7 select * from t0; +insert into t8 select * from t0; +insert into t9 select * from t0; commit; --enable_query_log -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed3; -select count(*) from innodb_page_compressed4; -select count(*) from innodb_page_compressed5; -select count(*) from innodb_page_compressed6; -select count(*) from innodb_page_compressed6; -select count(*) from innodb_page_compressed7; -select count(*) from innodb_page_compressed8; -select count(*) from innodb_page_compressed9; +select count(*) from t1; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; +select count(*) from t6; +select count(*) from t6; +select count(*) from t7; +select count(*) from t8; +select count(*) from t9; # # Wait until pages are really compressed @@ -61,71 +71,205 @@ let $wait_condition= select variable_value > 0 from information_schema.global_st --source include/shutdown_mysqld.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_normal.ibd +--let t1_IBD = $MYSQLD_DATADIR/test/t0.ibd --let SEARCH_RANGE = 10000000 --let SEARCH_PATTERN=AaAaAaAa ---echo # innodb_normal expected FOUND +--echo # t0 expected FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed1.ibd ---echo # innodb_page_compressed1 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd +--echo # t1 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed2.ibd ---echo # innodb_page_compressed2 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t2.ibd +--echo # t2 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed3.ibd ---echo # innodb_page_compressed3 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t3.ibd +--echo # t3 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed4.ibd ---echo # innodb_page_compressed4 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t4.ibd +--echo # t4 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed5.ibd ---echo # innodb_page_compressed5 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t5.ibd +--echo # t5 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed6.ibd ---echo # innodb_page_compressed6 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t6.ibd +--echo # t6 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed7.ibd ---echo # innodb_page_compressed7 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t7.ibd +--echo # t7 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed8.ibd ---echo # innodb_page_compressed8 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t8.ibd +--echo # t8 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc ---let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed9.ibd ---echo # innodb_page_compressed9 page compressed expected NOT FOUND +--let t1_IBD = $MYSQLD_DATADIR/test/t9.ibd +--echo # t9 page compressed expected NOT FOUND -- let SEARCH_FILE=$t1_IBD -- source include/search_pattern_in_file.inc +# +# Run innochecksum to all tables, all tables should be ok +# +let t_IBD = $MYSQLD_DATADIR/test/t0.ibd; +--exec $INNOCHECKSUM $t_IBD +let $i=9; +while $($i > 0) { +--echo # Run innochecksum on t$i +let t_IBD = $MYSQLD_DATADIR/test/t$i.ibd; +--exec $INNOCHECKSUM $t_IBD +dec $i; +} + -- source include/start_mysqld.inc -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed3; -select count(*) from innodb_page_compressed4; -select count(*) from innodb_page_compressed5; -select count(*) from innodb_page_compressed6; -select count(*) from innodb_page_compressed6; -select count(*) from innodb_page_compressed7; -select count(*) from innodb_page_compressed8; -select count(*) from innodb_page_compressed9; +select count(*) from t0; +select count(*) from t1; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; +select count(*) from t6; +select count(*) from t7; +select count(*) from t8; +select count(*) from t9; let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED'; --source include/wait_condition.inc -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +let MYSQLD_DATADIR=`select @@datadir`; + +--echo # Restart server +--source include/shutdown_mysqld.inc + +--echo # Corrupting tablespaces... + +# +# Now we corrupt page compressed pages as follows: +# (1) compression method +# (2) payload size +# (3) data +# (4) checksum +# +# Page 0 is not compressed or encrypted +# +perl; +sub ib_write_value { + my($fh, $file, $pos, $len, $val) = @_; + seek($fh, $pos, SEEK_SET) or die "$0: seek $file to pos $pos: $!";; + syswrite($fh, $val, $len) == $len or die "$0: write to $file val $val len $len: $!";; +} +sub ib_corrupt_table { + my($file, $pos, $val, $len) = @_; + open(my $fh, "+<", $file) or die "$0: open $file: $!"; + binmode $fh; + ib_write_value($fh, $file, $pos, $len, $val); + close $fh or die "$0: close $file: $!"; +} +sub ib_read_value { + my($fh, $file, $pos, $len) = @_; + seek($fh, $pos, SEEK_SET) or die "$0: seek $file to pos $pos: $!"; + sysread($fh, $buf, $len) == $len or die "$0: read $file : $!"; + return $buf; +} + +my($pos) = $ENV{'INNODB_PAGE_SIZE'} * 3; +my($file) = "$ENV{MYSQLD_DATADIR}/test/t1.ibd"; +open($fh, "+<", $file) or die "$0: open $file : $!"; +binmode $fh; + +# Find out the page type, compression method location is based on that +my($ptype) = unpack("n", ib_read_value($fh, $file, $pos+24, 2)); +if ($ptype == 34354) { + $pos += 32; # FLUSH_LSN_OR_KEY_VERSION + 6 +} else { + $pos += 40; # FIL_PAGE_DATA + 2 +} + +# Corrupt compression method by decreasing it by one, if zero set 6 +# Note that compression method is not encrypted +my($cmethod) = unpack("n", ib_read_value($fh, $file, $pos, 2)); +$cmethod--; +if ($cmethod == 0) { + $cmethod = 6; +} + +ib_write_value($fh, $file, $pos, 2, pack("n", $cmethod)); +close $fh or die $!; + +# (2) corrupt payload size by decreasing size by 50 and if 0 set it to 20 +# note that payload size is not encrypted +my($pos) = $ENV{'INNODB_PAGE_SIZE'} * 3 + 38; +my($file) = "$ENV{MYSQLD_DATADIR}/test/t2.ibd"; +open($fh, "+<", $file) or die "$0: open $file : $!"; +my($size) = unpack("n", ib_read_value($fh, $file, $pos, 2)); +$size -= 50; +if ($size <= 0) { + $size = 20; +} +ib_write_value($fh, $file, $pos, 2, pack("n", $size)); +close $fh or die $!; + +# (3) Corrupt data + +ib_corrupt_table("$ENV{MYSQLD_DATADIR}/test/t3.ibd", $ENV{'INNODB_PAGE_SIZE'} * 3 + 42, + "deadaaaaffffbbbb",14); + +# (4) Corrupt checksum +my($pos) = $ENV{'INNODB_PAGE_SIZE'} * 3; +my($file) = "$ENV{MYSQLD_DATADIR}/test/t4.ibd"; +open($fh, "+<", $file) or die "$0: open $file : $!"; + +# Find out the page type, checksum location is based on that +my($ptype) = unpack("n", ib_read_value($fh, $file, $pos + 24, 2)); +if ($ptype == 37401) { + $pos += 30; +} +ib_write_value($fh, $file, $pos, 4, pack("N", 1020102010)); +close $fh or die $!; +EOF + +--echo # Corruption done + +# +# Run innochecksum to page compressed (and maybe encrypted) tables +# now we should detect corruptions +# +let $i=4; +while $($i > 0) { +--echo # Run innochecksum on t$i +let t_IBD = $MYSQLD_DATADIR/test/t$i.ibd; +--error 1 +--exec $INNOCHECKSUM $t_IBD +dec $i; +} + +--echo # Start server again +--source include/start_mysqld.inc + +# +# Server should not crash on corrupted tables +# +--error ER_NOT_KEYFILE +select * from t1; +--error ER_NOT_KEYFILE +select * from t2; +--error ER_NOT_KEYFILE +select * from t3; +--error ER_NOT_KEYFILE +select * from t4; +select count(*) from t5; +select count(*) from t6; +select count(*) from t7; +select count(*) from t8; +select count(*) from t9; + +# We should be able to drop even corrupted tables + +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/doublewrite-compressed.result b/mysql-test/suite/innodb/r/doublewrite-compressed.result new file mode 100644 index 00000000000..b9b0be62b5e --- /dev/null +++ b/mysql-test/suite/innodb/r/doublewrite-compressed.result @@ -0,0 +1,253 @@ +# +# Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY +# Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST +# PAGE OF SYSTEM TABLESPACE +# +SET GLOBAL innodb_fast_shutdown = 0; +show variables like 'innodb_doublewrite'; +Variable_name Value +innodb_doublewrite ON +show variables like 'innodb_fil_make_page_dirty_debug'; +Variable_name Value +innodb_fil_make_page_dirty_debug 0 +show variables like 'innodb_saved_page_number_debug'; +Variable_name Value +innodb_saved_page_number_debug 0 +set global innodb_file_per_table=ON; +set global innodb_file_format='Barracuda'; +create table t1 (f1 int primary key, f2 blob) engine=innodb page_compressed=yes; +start transaction; +insert into t1 values(1, repeat('#',12)); +insert into t1 values(2, repeat('+',12)); +insert into t1 values(3, repeat('/',12)); +insert into t1 values(4, repeat('-',12)); +insert into t1 values(5, repeat('.',12)); +commit work; +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of user +# tablespace is full of zeroes. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +begin; +insert into t1 values (6, repeat('%', 12)); +# Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Make the first page (page_no=0) of the user tablespace +# full of zeroes. +# +# MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of user +# tablespace is corrupted. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +begin; +insert into t1 values (6, repeat('%', 12)); +# Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Corrupt the first page (page_no=0) of the user tablespace. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of user +# tablespace is full of zeroes. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +begin; +insert into t1 values (6, repeat('%', 400)); +# Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Make the 2nd page (page_no=1) of the tablespace all zeroes. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of user +# tablespace is corrupted. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +begin; +insert into t1 values (6, repeat('%', 400)); +# Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that the dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Corrupt the 2nd page (page_no=1) of the user tablespace. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of +# system tablespace is full of zeroes. +begin; +insert into t1 values (6, repeat('%', 400)); +# Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; +# Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Make the first page (page_no=0) of the system tablespace +# all zeroes. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of +# system tablespace is corrupted. +begin; +insert into t1 values (6, repeat('%', 400)); +# Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; +# Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Corrupt the first page (page_no=0) of the system tablespace. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of +# system tablespace is full of zeroes. +begin; +insert into t1 values (6, repeat('%', 400)); +# Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; +# Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Make the 2nd page (page_no=1) of the system tablespace +# all zeroes. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of +# system tablespace is corrupted. +begin; +insert into t1 values (6, repeat('%', 400)); +# Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; +# Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +# Kill the server +# Make the 2nd page (page_no=1) of the system tablespace +# all zeroes. +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +FOUND /\[ERROR\] InnoDB: .* in tablespace.*test.t1.*/ in mysqld.1.err +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +drop table t1; +# +# MDEV-12600 crash during install_db with innodb_page_size=32K +# and ibdata1=3M +# +SELECT * FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS +FOUND /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result index 3a3d6f92cac..d0530d5bef3 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result @@ -1,98 +1,135 @@ set global innodb_compression_algorithm = bzip2; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +bzip2 set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_default.result b/mysql-test/suite/innodb/r/innodb-page_compression_default.result index 18f7fb5e04a..9cf3e969ba8 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_default.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_default.result @@ -1,98 +1,133 @@ call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; #done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result index d60eb62ec15..2722e36c34a 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result @@ -1,98 +1,135 @@ set global innodb_compression_algorithm = lz4; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +lz4 set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result index b3cc9c9b627..aa1dbec22ae 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result @@ -1,98 +1,135 @@ set global innodb_compression_algorithm = lzma; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +lzma set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result index b6c5bc32bb7..204ff52d3f5 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result @@ -1,98 +1,135 @@ set global innodb_compression_algorithm = lzo; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +lzo set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result index 74cfa9bce3a..693e5ed8f3b 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result @@ -1,99 +1,136 @@ call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); set global innodb_compression_algorithm = snappy; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +snappy set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result index 3644890f921..d98b4e8e229 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result @@ -1,98 +1,135 @@ set global innodb_compression_algorithm = zlib; +select @@innodb_compression_algorithm; +@@innodb_compression_algorithm +zlib set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; -create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; -create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; -create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; -create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; -create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; -create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; -create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; -create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; -create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -# innodb_normal expected FOUND -FOUND /AaAaAaAa/ in innodb_normal.ibd -# innodb_page_compressed1 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd -# innodb_page_compressed2 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd -# innodb_page_compressed3 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd -# innodb_page_compressed4 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd -# innodb_page_compressed5 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd -# innodb_page_compressed6 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd -# innodb_page_compressed7 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd -# innodb_page_compressed8 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd -# innodb_page_compressed9 page compressed expected NOT FOUND -NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd -select count(*) from innodb_page_compressed1; -count(*) -10000 -select count(*) from innodb_page_compressed3; -count(*) -10000 -select count(*) from innodb_page_compressed4; -count(*) -10000 -select count(*) from innodb_page_compressed5; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed6; -count(*) -10000 -select count(*) from innodb_page_compressed7; -count(*) -10000 -select count(*) from innodb_page_compressed8; -count(*) -10000 -select count(*) from innodb_page_compressed9; -count(*) -10000 -drop table innodb_normal; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; -#done +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \\[page id: space=[0-9]+, page number=[0-9]+\\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Page \\[page id: space=[0-9]+, page number= [0-9]+\\] in file ./test/t[0-9]+.ibd may be corrupted. Post compression checksum [0-9]+ stored [0-9]+ compression_method [ZLIB|SNAPPY|LZ4|LZO|LZMA|BZIP2]"); +call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt \\[page id: space=[0-9]+, page number=[0-9]+\\]"); +call mtr.add_suppression("mysqld: Index for table 't[0-9]+' is corrupt; try to repair it"); +create table t0 (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table t1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table t2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table t3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table t4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table t5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table t6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table t7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table t8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table t9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# t0 expected FOUND +FOUND /AaAaAaAa/ in t0.ibd +# t1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t1.ibd +# t2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t2.ibd +# t3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t3.ibd +# t4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t4.ibd +# t5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t5.ibd +# t6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t6.ibd +# t7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t7.ibd +# t8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t8.ibd +# t9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in t9.ibd +# Run innochecksum on t9 +# Run innochecksum on t8 +# Run innochecksum on t7 +# Run innochecksum on t6 +# Run innochecksum on t5 +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +select count(*) from t0; +count(*) +500 +select count(*) from t1; +count(*) +500 +select count(*) from t3; +count(*) +500 +select count(*) from t4; +count(*) +500 +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +# Restart server +# Corrupting tablespaces... +# Corruption done +# Run innochecksum on t4 +# Run innochecksum on t3 +# Run innochecksum on t2 +# Run innochecksum on t1 +# Start server again +select * from t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +select * from t2; +ERROR HY000: Incorrect key file for table 't2'; try to repair it +select * from t3; +ERROR HY000: Incorrect key file for table 't3'; try to repair it +select * from t4; +ERROR HY000: Incorrect key file for table 't4'; try to repair it +select count(*) from t5; +count(*) +500 +select count(*) from t6; +count(*) +500 +select count(*) from t7; +count(*) +500 +select count(*) from t8; +count(*) +500 +select count(*) from t9; +count(*) +500 +drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result index 989e433338e..c329333a718 100644 --- a/mysql-test/suite/innodb/r/innodb_bug14147491.result +++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result @@ -1,6 +1,6 @@ call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate."); call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); # Create and populate the table to be corrupted set global innodb_file_per_table=ON; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb/t/doublewrite-compressed.test b/mysql-test/suite/innodb/t/doublewrite-compressed.test new file mode 100644 index 00000000000..90f62576a7f --- /dev/null +++ b/mysql-test/suite/innodb/t/doublewrite-compressed.test @@ -0,0 +1,439 @@ +--echo # +--echo # Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY +--echo # Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST +--echo # PAGE OF SYSTEM TABLESPACE +--echo # + +--source include/innodb_page_size.inc +--source include/have_debug.inc +--source include/not_embedded.inc + +# Slow shutdown and restart to make sure ibuf merge is finished +SET GLOBAL innodb_fast_shutdown = 0; +--disable_query_log +call mtr.add_suppression("space header page consists of zero bytes.*test.t1"); +call mtr.add_suppression("checksum mismatch in tablespace.*test.t1"); +call mtr.add_suppression("Current page size .* != page size on page"); +call mtr.add_suppression("innodb-page-size mismatch in tablespace.*test.t1"); +call mtr.add_suppression("InnoDB: New log files created"); +call mtr.add_suppression("InnoDB: Cannot create doublewrite buffer: the first file in innodb_data_file_path must be at least (3|6|12)M\\."); +call mtr.add_suppression("InnoDB: Database creation was aborted"); +call mtr.add_suppression("Plugin 'InnoDB' (init function returned error|registration as a STORAGE ENGINE failed)"); +--enable_query_log +--source include/restart_mysqld.inc + +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +let MYSQLD_DATADIR=`select @@datadir`; +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_RANGE= -50000; + +show variables like 'innodb_doublewrite'; +show variables like 'innodb_fil_make_page_dirty_debug'; +show variables like 'innodb_saved_page_number_debug'; + +--disable_warnings +set global innodb_file_per_table=ON; +set global innodb_file_format='Barracuda'; +--enable_warnings +create table t1 (f1 int primary key, f2 blob) engine=innodb page_compressed=yes; + +start transaction; +insert into t1 values(1, repeat('#',12)); +insert into t1 values(2, repeat('+',12)); +insert into t1 values(3, repeat('/',12)); +insert into t1 values(4, repeat('-',12)); +insert into t1 values(5, repeat('.',12)); +commit work; + +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of user +--echo # tablespace is full of zeroes. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +begin; +insert into t1 values (6, repeat('%', 12)); + +--source ../include/no_checkpoint_start.inc + +--echo # Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; + +--let CLEANUP_IF_CHECKPOINT=drop table t1; +--source ../include/no_checkpoint_end.inc + +--echo # Make the first page (page_no=0) of the user tablespace +--echo # full of zeroes. +--echo # +--echo # MDEV-11623: Use old FSP_SPACE_FLAGS in the doublewrite buffer. + +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +my $page_size = $ENV{INNODB_PAGE_SIZE}; +my $page; +open(FILE, "+<", $fname) or die; +sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n"; +sysseek(FILE, 0, 0)||die "Unable to seek $fname\n"; +die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size; +close FILE; + +open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open ibdata1\n"; +sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n"; +sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n"; +my($magic,$d1,$d2)=unpack "NNN", $_; +die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64; +sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n"; +# Find the page in the doublewrite buffer +for (my $d = $d1; $d < $d2 + 64; $d++) +{ + sysread(FILE, $_, $page_size)==$page_size||die "Cannot read doublewrite\n"; + next unless $_ eq $page; + sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n"; + # Write buggy MariaDB 10.1.x FSP_SPACE_FLAGS to the doublewrite buffer + my($flags) = unpack "x[54]N", $_; + my $badflags = ($flags & 0x3f); + my $compression_level=6; + $badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16); + $badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE + + substr ($_, 54, 4) = pack("N", $badflags); + # Replace the innodb_checksum_algorithm=none checksum + substr ($_, 0, 4) = pack("N", 0xdeadbeef); + substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef); + syswrite(FILE, $_, $page_size)==$page_size||die; + close(FILE); + exit 0; +} +die "Did not find the page in the doublewrite buffer ($d1,$d2)\n"; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of user +--echo # tablespace is corrupted. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +begin; +insert into t1 values (6, repeat('%', 12)); + +--source ../include/no_checkpoint_start.inc + +--echo # Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/no_checkpoint_end.inc + +--echo # Corrupt the first page (page_no=0) of the user tablespace. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of user +--echo # tablespace is full of zeroes. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +begin; +insert into t1 values (6, repeat('%', 400)); + +--source ../include/no_checkpoint_start.inc + +--echo # Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/no_checkpoint_end.inc + +--echo # Make the 2nd page (page_no=1) of the tablespace all zeroes. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of user +--echo # tablespace is corrupted. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +begin; +insert into t1 values (6, repeat('%', 400)); + +--source ../include/no_checkpoint_start.inc + +--echo # Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that the dirty pages of table t1 are flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/no_checkpoint_end.inc + +--echo # Corrupt the 2nd page (page_no=1) of the user tablespace. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of +--echo # system tablespace is full of zeroes. + +begin; +insert into t1 values (6, repeat('%', 400)); + +--echo # Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +# We do this after the transaction starts and all dirty pages have been flushed +# already. So flushing of this specified dirty page will surely keep the +# copy in doublewrite buffer, and no more writes to doublewrite buffer would +# overwrite the copy. Thus, we can safely modify the original page when server +# is down. So do the following testings. +set global innodb_buf_flush_list_now = 1; + +--source include/kill_mysqld.inc + +--echo # Make the first page (page_no=0) of the system tablespace +--echo # all zeroes. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of +--echo # system tablespace is corrupted. + +begin; +insert into t1 values (6, repeat('%', 400)); + +--echo # Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/kill_mysqld.inc + +--echo # Corrupt the first page (page_no=0) of the system tablespace. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of +--echo # system tablespace is full of zeroes. + +begin; +insert into t1 values (6, repeat('%', 400)); + +--echo # Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/kill_mysqld.inc + +--echo # Make the 2nd page (page_no=1) of the system tablespace +--echo # all zeroes. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of +--echo # system tablespace is corrupted. + +begin; +insert into t1 values (6, repeat('%', 400)); + +--echo # Ensure that all dirty pages in the system are flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; + +--source include/kill_mysqld.inc + +--echo # Make the 2nd page (page_no=1) of the system tablespace +--echo # all zeroes. +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--source include/start_mysqld.inc + +check table t1; +--let SEARCH_PATTERN= \[ERROR\] InnoDB: .* in tablespace.*test.t1.* +--source include/search_pattern_in_file.inc + +select f1, f2 from t1; + +drop table t1; + +--echo # +--echo # MDEV-12600 crash during install_db with innodb_page_size=32K +--echo # and ibdata1=3M +--echo # +let bugdir= $MYSQLTEST_VARDIR/tmp/doublewrite; +--mkdir $bugdir + +let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); + +--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir +--let $ibd=$ibp --innodb-undo-tablespaces=0 --innodb-log-files-in-group=2 +--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend + +--let $restart_parameters= $ibp +--source include/restart_mysqld.inc +eval $check_no_innodb; +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot create doublewrite buffer +--source include/search_pattern_in_file.inc +--let $restart_parameters= +--source include/restart_mysqld.inc + +--remove_file $bugdir/ibdata1 +--remove_file $bugdir/ibdata2 +--remove_file $bugdir/ib_logfile0 +--remove_file $bugdir/ib_logfile1 +--rmdir $bugdir diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test index 8c4cee14453..aae5c51c123 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test @@ -2,10 +2,13 @@ -- source include/have_innodb_bzip2.inc -- source include/not_embedded.inc -# bzip2 set global innodb_compression_algorithm = bzip2; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test index 9d6e2babbe7..bd0097532dd 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test @@ -5,8 +5,12 @@ # lz4 set global innodb_compression_algorithm = lz4; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test index 0b97c1578c6..1ab2cce74f4 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test @@ -2,10 +2,14 @@ -- source include/have_innodb_lzma.inc -- source include/not_embedded.inc -# lzma set global innodb_compression_algorithm = lzma; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log + diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test index aec07beeca6..14438bb7ec3 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test @@ -2,10 +2,13 @@ -- source include/have_innodb_lzo.inc -- source include/not_embedded.inc -# lzo set global innodb_compression_algorithm = lzo; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test index 532ec294d28..c9e00c7f257 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test @@ -4,10 +4,13 @@ call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); -# snappy set global innodb_compression_algorithm = snappy; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test index ed3a27ada7b..bfcda0ea747 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test @@ -1,10 +1,13 @@ --source include/have_innodb.inc --source include/not_embedded.inc -# lz4 set global innodb_compression_algorithm = zlib; +select @@innodb_compression_algorithm; -# All page compression test use the same +# All page compression tests use the same --source include/innodb-page-compression.inc --- echo #done +# reset system +--disable_query_log +set global innodb_compression_algorithm=default; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test index c21515e7d05..22bc17f0bf6 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14147491.test +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -6,7 +6,7 @@ call mtr.add_suppression("InnoDB: Table \"test\".\"t1\" is corrupted. Please drop the table and recreate."); call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); # Don't test under embedded source include/not_embedded.inc; @@ -67,7 +67,7 @@ EOF --echo # Now t1 is corrupted but we should not crash ---error 1712,1932 +--error ER_GET_ERRNO,ER_INDEX_CORRUPT,ER_NO_SUCH_TABLE_IN_ENGINE,ER_NOT_KEYFILE SELECT * FROM t1; --error 1034,1712,1932 |