summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption/t/corrupted_during_recovery.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/encryption/t/corrupted_during_recovery.test')
-rw-r--r--mysql-test/suite/encryption/t/corrupted_during_recovery.test7
1 files changed, 5 insertions, 2 deletions
diff --git a/mysql-test/suite/encryption/t/corrupted_during_recovery.test b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
index 94fcd5f382d..42cdd13d206 100644
--- a/mysql-test/suite/encryption/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
@@ -11,10 +11,12 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=\\d+, page number=3
call mtr.add_suppression("InnoDB: Table in tablespace \\d+ encrypted. However key management plugin or used key_version \\d+ is not found or used encryption algorithm or method does not match. Can't continue opening the table.");
--enable_query_log
+let INNODB_CHECKSUM_ALGORITHM = `SELECT @@innodb_checksum_algorithm`;
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB, ENCRYPTED=YES;
INSERT INTO t1 VALUES(1);
# Force a redo log checkpoint.
+let $restart_noprint=2;
--source include/restart_mysqld.inc
--source ../../suite/innodb/include/no_checkpoint_start.inc
CREATE TABLE t2(a BIGINT PRIMARY KEY) ENGINE=InnoDB, ENCRYPTED=YES;
@@ -33,7 +35,8 @@ my $ps = $ENV{INNODB_PAGE_SIZE};
my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
open(FILE, "+<$file") || die "Unable to open $file";
binmode FILE;
-seek (FILE, $ENV{INNODB_PAGE_SIZE} * 3, SEEK_SET) or die "seek";
+my $offset = ($ENV{INNODB_CHECKSUM_ALGORITHM} =~ /full_crc32/) ? 26 : 0;
+seek (FILE, $ENV{INNODB_PAGE_SIZE} * 3 + $offset, SEEK_SET) or die "seek";
print FILE "junk";
close FILE or die "close";
@@ -51,7 +54,7 @@ EOF
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
--disable_query_log
-call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[1].ibd looks corrupted; key_version=1786080875");
+call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[1].ibd looks corrupted; key_version=");
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted. Please drop the table and recreate.");
--enable_query_log
let $restart_parameters=--innodb_force_recovery=1 --skip-innodb-buffer-pool-load-at-startup;