Debian Codegraph @

mysql-test/suite/mariabackup/defer_space.test

raw
1 --source include/have_innodb.inc
2 --source include/have_debug.inc
3 --source include/not_embedded.inc
4 --source include/no_valgrind_without_big.inc
5
6 call mtr.add_suppression("InnoDB: Expected tablespace id .*");
7 --echo # Mariabackup --backup with page0 INIT_PAGE redo record
8 --echo # and there is no FILE_CREATE for the tablespace t1
9 SET @save_dbug = @@SESSION.debug_dbug;
10 SET DEBUG_DBUG="+d,checkpoint_after_file_create";
11 CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
12 INSERT INTO t1 VALUES(1);
13
14 echo # xtrabackup backup;
15 let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
16
17 --disable_result_log
18 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
19 --enable_result_log
20
21 echo # xtrabackup prepare;
22 --disable_result_log
23 exec $XTRABACKUP --prepare --target-dir=$targetdir;
24 -- source include/restart_and_restore.inc
25 --enable_result_log
26
27 SELECT * FROM t1;
28 DROP TABLE t1;
29 rmdir $targetdir;
30 SET @@SESSION.DEBUG_DBUG= @save_debug;
31
32 --echo # Mariabackup fails after corrupting the page0 in disk
33 --echo # and there is no INIT_PAGE for page0
34
35 CREATE TABLE t1(c INT) ENGINE=INNODB;
36 let MYSQLD_DATADIR=`select @@datadir`;
37 let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
38 --source include/shutdown_mysqld.inc
39
40 --echo # Corrupt the table
41
42 perl;
43 my $ps = $ENV{INNODB_PAGE_SIZE};
44
45 my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
46 open(FILE, "+<$file") || die "Unable to open $file";
47 binmode FILE;
48 seek (FILE, 0, SEEK_SET) or die "seek";
49 print FILE chr(0x00) x $ps;
50 close FILE or die "close";
51 EOF
52
53 --source include/start_mysqld.inc
54 echo # xtrabackup backup;
55 let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
56 let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
57 --disable_result_log
58 --error 1
59 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog;
60 --enable_result_log
61
62 --let SEARCH_PATTERN=Header page consists of zero bytes*
63 --let SEARCH_FILE=$backuplog
64 --source include/search_pattern_in_file.inc
65 UNLOCK TABLES;
66 DROP TABLE t1;
67 rmdir $targetdir;
68 remove_file $backuplog;