Debian Codegraph @

mysql-test/suite/mariabackup/undo_truncate.test

raw
1 --source include/have_innodb.inc
2 --source include/not_embedded.inc
3 --source include/have_sequence.inc
4 --source include/have_file_key_management.inc
5
6 SET GLOBAL innodb_undo_log_truncate = 0;
7
8 #
9 # Perform DML action using multiple clients and multiple undo tablespace.
10 #
11
12 create table t1 (keyc int primary key default 0, c char(6)) engine=innodb;
13 create table t2 (keyc int primary key default 0, c char(6)) engine=innodb;
14
15 DELIMITER $$;
16 CREATE PROCEDURE p(t VARCHAR(64))
17 BEGIN
18 DECLARE i TEXT DEFAULT 'insert into t1 select seq,repeat(chr(48),6)
19 from seq_1_to_20000';
20 DECLARE u1 TEXT DEFAULT 'update t1 set c=repeat(chr(32),6)';
21 DECLARE u2 TEXT DEFAULT 'update t1 set c=repeat(chr(64),6)';
22 EXECUTE IMMEDIATE REPLACE(i,'t1', t);
23 EXECUTE IMMEDIATE REPLACE(u1,'t1', t);
24 EXECUTE IMMEDIATE REPLACE(u2,'t1', t);
25 END;
26 $$
27 DELIMITER ;$$
28
29 connect (con1,localhost,root,,);
30 begin;
31 send call p('t1');
32
33 connection default;
34 call p('t2');
35
36 connection con1;
37 reap;
38 commit;
39 disconnect con1;
40 connection default;
41 DROP PROCEDURE p;
42
43 SET GLOBAL innodb_undo_log_truncate = 1;
44 SET GLOBAL innodb_max_undo_log_size=DEFAULT;
45 SET GLOBAL innodb_max_purge_lag_wait=0;
46 let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
47
48 --disable_result_log
49 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --throttle=1000;
50 --echo # Prepare full backup
51 exec $XTRABACKUP --prepare --target-dir=$targetdir;
52 --enable_result_log
53
54 source include/restart_and_restore.inc;
55 select count(*) from t1;
56 select count(*) from t2;
57 # Cleanup
58 rmdir $targetdir;
59 DROP TABLE t1,t2;