Skip to content

Commit 8b3b6dc

Browse files
committed
test how MDL blocks InnoDB purge
it must, because purge opens a table that might be being altered right now
1 parent 1cae1af commit 8b3b6dc

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,23 @@ a b c
138138
6 6 12
139139
8 8 16
140140
DROP TABLE t0, t1;
141+
create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100)));
142+
insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk");
143+
insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm");
144+
set global innodb_purge_stop_now = 1;
145+
set global debug_dbug="+d,ib_purge_virtual_index_callback";
146+
update t set a = repeat('m', 16000) where a like "aaa%";
147+
connect con1, localhost, root;
148+
lock table t write;
149+
connection default;
150+
set global innodb_purge_run_now=1;
151+
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
152+
variable_value>1
153+
1
154+
disconnect con1;
155+
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
156+
variable_value>1
157+
0
158+
set global debug_dbug=@old_dbug;
159+
drop table t;
141160
set debug_sync=reset;

mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,26 @@ SELECT * FROM t1;
169169

170170
DROP TABLE t0, t1;
171171

172-
--source include/wait_until_count_sessions.inc
172+
#
173+
# test MDLs with purge
174+
#
175+
create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100)));
176+
insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk");
177+
insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm");
178+
set global innodb_purge_stop_now = 1;
179+
set global debug_dbug="+d,ib_purge_virtual_index_callback";
180+
update t set a = repeat('m', 16000) where a like "aaa%";
181+
connect(con1, localhost, root);
182+
lock table t write;
183+
connection default;
184+
set global innodb_purge_run_now=1;
185+
sleep 3;
186+
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
187+
disconnect con1;
188+
sleep 3;
189+
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
190+
set global debug_dbug=@old_dbug;
191+
drop table t;
173192

193+
--source include/wait_until_count_sessions.inc
174194
set debug_sync=reset;

0 commit comments

Comments
 (0)