Debian Codegraph @

mysql-test/suite/maria/maria-purge.test

raw
1 -- source include/have_maria.inc
2 -- source include/big_test.inc
3 -- source include/not_embedded.inc
4
5 # pre-requisites for aria_empty_logs
6 connect (admin, localhost, root,,test,,);
7 #
8 --enable_reconnect
9 connection default;
10 --enable_reconnect
11 # end of pre-requisites
12
13 # SHOW ENGINE ARIA LOGS could be influenced by older logs
14 # Also, possibly automatic checkpoints (see if that happens in
15 # practice)
16 -- source include/maria_empty_logs.inc
17
18 let $default=`select @@global.default_storage_engine`;
19 set global default_storage_engine=aria;
20 set session default_storage_engine=aria;
21 let $def_logsize=`select @@global.aria_log_file_size`;
22 let $def_checkinterval=`select @@global.aria_checkpoint_interval`;
23
24 set global aria_log_file_size=4294959104;
25 # Initialise
26 --disable_warnings
27 drop table if exists t1,t2;
28 --enable_warnings
29 SET SQL_WARNINGS=1;
30
31 CREATE TABLE t1 (
32 STRING_DATA char(255) default NULL
33 );
34 CREATE TABLE t2 (
35 STRING_DATA char(255) default NULL
36 );
37
38
39 INSERT INTO t1 VALUES ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
40 INSERT INTO t1 VALUES ('DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD');
41 insert into t2 select * from t1;
42 insert into t1 select * from t2;
43 insert into t2 select * from t1;
44 insert into t1 select * from t2;
45 insert into t2 select * from t1;
46 insert into t1 select * from t2;
47 insert into t2 select * from t1;
48 insert into t1 select * from t2;
49 insert into t2 select * from t1;
50 insert into t1 select * from t2;
51 insert into t2 select * from t1;
52 insert into t1 select * from t2;
53 insert into t2 select * from t1;
54 insert into t1 select * from t2;
55 insert into t2 select * from t1;
56 insert into t1 select * from t2;
57 insert into t2 select * from t1;
58 insert into t1 select * from t2;
59 insert into t2 select * from t1;
60 insert into t1 select * from t2;
61 insert into t2 select * from t1;
62 insert into t1 select * from t2;
63
64 set global aria_log_file_size=16777216;
65 # force a checkpoint to allow log purge
66 eval set global aria_checkpoint_interval=$def_checkinterval;
67 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
68 SHOW ENGINE aria logs;
69
70 insert into t2 select * from t1;
71 insert into t1 select * from t2;
72
73 eval set global aria_checkpoint_interval=$def_checkinterval;
74 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
75 SHOW ENGINE aria logs;
76 set global aria_log_file_size=16777216;
77 select @@global.aria_log_file_size;
78 eval set global aria_checkpoint_interval=$def_checkinterval;
79 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
80 SHOW ENGINE aria logs;
81 set global aria_log_file_size=8388608;
82 select @@global.aria_log_file_size;
83
84 set global aria_log_purge_type=at_flush;
85 insert into t1 select * from t2;
86 eval set global aria_checkpoint_interval=$def_checkinterval;
87 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
88 SHOW ENGINE aria logs;
89 flush logs;
90 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
91 SHOW ENGINE aria logs;
92
93 set global aria_log_file_size=16777216;
94 set global aria_log_purge_type=external;
95 insert into t1 select * from t2;
96 eval set global aria_checkpoint_interval=$def_checkinterval;
97 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
98 SHOW ENGINE aria logs;
99 flush logs;
100 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
101 SHOW ENGINE aria logs;
102
103 set global aria_log_purge_type=immediate;
104 insert into t1 select * from t2;
105 eval set global aria_checkpoint_interval=$def_checkinterval;
106 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
107 SHOW ENGINE aria logs;
108
109 drop table t1, t2;
110
111 --disable_result_log
112 --disable_query_log
113 set global aria_log_purge_type=immediate;
114 eval set global default_storage_engine=$default;
115 eval set global aria_log_file_size=$def_logsize;
116 eval set global aria_checkpoint_interval=$def_checkinterval;
117 --enable_result_log
118 --enable_query_log