Debian Codegraph @

mysql-test/suite/mariabackup/incremental_ddl_before_backup.test

raw
1 --source include/have_debug.inc
2 --source include/innodb_undo_tablespaces.inc
3
4 call mtr.add_suppression("InnoDB: New log files created");
5
6 let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
7 let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
8
9 CREATE TABLE t1(i INT) ENGINE INNODB;
10 CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB;
11 CREATE TABLE t3(i INT) ENGINE INNODB;
12
13 echo # Create full backup , modify table, then create incremental/differential backup;
14 --disable_result_log
15 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
16 --enable_result_log
17
18 create table t4(f1 int not null, f2 int not null)engine=innodb;
19 insert into t4 values(1, 2), (2, 2), (3, 3), (5, 5), (6, 6), (4, 4), (9, 9);
20 insert into t4 select * from t4;
21 insert into t4 select * from t4;
22 insert into t4 select * from t4;
23 insert into t4 select * from t4;
24 insert into t4 select * from t4;
25 insert into t4 select * from t4;
26 insert into t4 select * from t4;
27 insert into t4 select * from t4;
28 insert into t4 select * from t4;
29 insert into t4 select * from t4;
30 rename table t4 to t7;
31 select count(*) from t7;
32
33 --echo # XTRABACKUP INCREMENTAL
34 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
35
36 --echo # XTRABACKUP PREPARE
37 exec $XTRABACKUP --prepare --target-dir=$basedir;
38
39 --echo # XTRABACKUP INCREMENTAL PREPARE
40 exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
41
42 let $targetdir=$basedir;
43 -- source include/restart_and_restore.inc
44 --enable_result_log
45
46 select count(*) from t7;
47 drop table t1, t2, t7, t3;
48
49 # Cleanup
50 rmdir $basedir;
51 rmdir $incremental_dir;