Debian Codegraph @

mysql-test/suite/mariabackup/encrypted_page_compressed.test

raw
1 source include/have_file_key_management.inc;
2 call mtr.add_suppression("InnoDB: Table `test`.`t1` has an unreadable root page");
3 call mtr.add_suppression("InnoDB: Encrypted page .* in file .*test.t1\\.ibd looks corrupted; key_version=1");
4 call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to read page 3 from file '.*test/t1\\.ibd'");
5 call mtr.add_suppression("\\[ERROR\\] InnoDB: File '.*test/t1\\.ibd' is corrupted");
6 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT, c char(200)) ENGINE=InnoDB page_compressed=yes encrypted=yes;
7 insert into t1(b, c) values("mariadb", "mariabackup");
8
9 let $MYSQLD_DATADIR=`select @@datadir`;
10 let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
11 let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
12
13 --source include/shutdown_mysqld.inc
14
15 --echo # Corrupt the table
16
17 perl;
18 use strict;
19 use warnings;
20 use Fcntl qw(:DEFAULT :seek);
21
22 my $ibd_file = $ENV{'t1_IBD'};
23
24 my $chunk;
25 my $page_size = $ENV{'INNODB_PAGE_SIZE'};
26
27 sysopen IBD_FILE, $ibd_file, O_RDWR || die "Unable to open $ibd_file";
28 sysseek IBD_FILE, $page_size * 3 + 75, SEEK_CUR;
29 $chunk = '\xAA\xAA\xAA\xAA';
30 syswrite IBD_FILE, $chunk, 4;
31
32 close IBD_FILE;
33 EOF
34
35 --source include/start_mysqld.inc
36
37 echo # xtrabackup backup;
38 --disable_result_log
39 let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
40 let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
41 --error 1
42 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --core-file > $backuplog;
43 --enable_result_log
44
45 --let SEARCH_PATTERN=Database page corruption detected.*
46 --let SEARCH_FILE=$backuplog
47 --source include/search_pattern_in_file.inc
48 remove_file $backuplog;
49
50 drop table t1;
51 rmdir $targetdir;