Debian Codegraph @

mysql-test/suite/innodb/t/undo_truncate.test

raw
1 --source include/have_innodb.inc
2 --source include/innodb_page_size.inc
3 --source include/not_embedded.inc
4 --source include/have_sequence.inc
5 --source include/no_valgrind_without_big.inc
6
7 --disable_query_log
8 call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
9 --disable_query_log
10 # This may be triggered on a slow system.
11 call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
12 --enable_query_log
13
14 # Re-create the undo log tablespaces after slow shutdown
15 SET GLOBAL innodb_fast_shutdown=0;
16 let $restart_parameters=--innodb_undo_tablespaces=2;
17 --source include/restart_mysqld.inc
18
19 SET GLOBAL innodb_undo_log_truncate = 0;
20
21 LET $MYSQLD_DATADIR = `select @@datadir`;
22 LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
23 --source suite/innodb/include/show_i_s_tablespaces.inc
24 #-----------------------------------------------------------------------------
25 #
26 # Perform DML action using multiple clients and multiple undo tablespace.
27 #
28 #
29 create table t1(keyc int primary key, c char(100)) engine = innodb;
30 create table t2(keyc int primary key, c char(100)) engine = innodb;
31 #
32 let DATADIR = `select @@datadir`;
33 connect (con1,localhost,root,,);
34 begin;
35 send insert into t1 select seq,'a' from seq_1_to_20000;
36
37 connect (con2,localhost,root,,);
38 begin;
39 send insert into t2 select seq,'a' from seq_1_to_20000;
40
41 connection con1; reap; send update t1 set c = 'mysql';
42 connection con2; reap; send update t2 set c = 'mysql';
43 connection con1; reap; send update t1 set c = 'oracle';
44 connection con2; reap; send update t2 set c = 'oracle';
45 connection con1; reap; send delete from t1;
46 connection con2; reap; delete from t2;
47 connection con1; reap;
48
49 SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
50 SET GLOBAL innodb_undo_log_truncate = 1;
51 commit; disconnect con1;
52 connection con2; commit; disconnect con2;
53
54 connection default;
55
56 --replace_regex /.*Trx id counter ([0-9]+).*/\1/
57 let $trx_before= `SHOW ENGINE INNODB STATUS`;
58 let $trx_before= `select substr('$trx_before',9)+2`;
59
60 SET GLOBAL innodb_max_purge_lag_wait=0;
61 SET GLOBAL innodb_max_undo_log_size=DEFAULT;
62 SET GLOBAL innodb_max_purge_lag_wait=0;
63 set global innodb_fast_shutdown=0;
64 let $restart_parameters=;
65 --source include/restart_mysqld.inc
66 --replace_regex /.*Trx id counter ([0-9]+).*/\1/
67 let $trx_after= `SHOW ENGINE INNODB STATUS`;
68 let $trx_after= `select substr('$trx_after',9)`;
69
70 drop table t1, t2;
71
72 if ($trx_before > $trx_after)
73 {
74 echo Transaction sequence mismatch: $trx_before > $trx_after;
75 }