Debian Codegraph @

mysql-test/suite/mariabackup/recreate_table_during_backup.test

raw
1 --source include/have_debug.inc
2 let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
3 mkdir $targetdir;
4
5 CREATE TABLE t1(i int) ENGINE=INNODB;
6 CREATE TABLE t2(i int) ENGINE=INNODB;
7 CREATE TABLE t3(a CHAR(36)) ENGINE INNODB;
8 INSERT INTO t3 SELECT UUID() FROM seq_1_to_1000;
9
10 set global innodb_log_checkpoint_now=1;
11 # this will table and populate it, after backup has list of tables to be copied
12 --let before_copy_test_t1=BEGIN NOT ATOMIC DROP TABLE test.t1;CREATE TABLE test.t1 ENGINE=INNODB SELECT UUID() from test.seq_1_to_100; END
13 --let after_copy_test_t2=BEGIN NOT ATOMIC DROP TABLE test.t2;CREATE TABLE test.t2 ENGINE=INNODB SELECT UUID() from test.seq_1_to_1000; END
14 --let after_copy_test_t3=ALTER TABLE test.t3 ADD INDEX index_a(a),ALGORITHM=COPY
15 echo # xtrabackup backup;
16 --disable_result_log
17 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --close-files --dbug=+d,mariabackup_events;
18 --enable_result_log
19 --let after_load_tables=
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 # Check that new table is there after restore.
28 SELECT COUNT(*) from t1;
29 SELECT COUNT(*) from t2;
30 SELECT COUNT(*) from t3;
31 DROP INDEX index_a ON t3;
32 DROP TABLE t1;
33 DROP TABLE t2;
34 DROP TABLE t3;
35 rmdir $targetdir;
36
37
38