1
# Let's see if FLUSH TABLES WITH READ LOCK can be killed when waiting
2
# for running commits to finish (in the past it could not)
3
# This will not be a meaningful test on non-debug servers so will be
5
# If running mysql-test-run --debug, the --debug added by
6
# mysql-test-run to the mysqld command line will override the one of
7
# -master.opt. But this test is designed to still pass then (though it
8
# won't test anything interesting).
10
# This also won't work with the embedded server test
11
-- source include/not_embedded.inc
13
-- source include/have_debug.inc
15
connect (con1,localhost,root,,);
16
connect (con2,localhost,root,,);
20
drop table if exists t1;
22
create table t1 (kill_id int);
23
insert into t1 values(connection_id());
25
# Thanks to the parameter we passed to --debug, this FLUSH will
26
# block on a debug build running with our --debug=make_global... It
27
# will block until killed. In other cases (non-debug build or other
28
# --debug) it will succeed immediately
31
send flush tables with read lock;
35
select ((@id := kill_id) - kill_id) from t1;
37
--sleep 2 # leave time for FLUSH to block
41
# On debug builds it will be error 1053 (killed); on non-debug, or
42
# debug build running without our --debug=make_global..., will be
43
# error 0 (no error). The only important thing to test is that on
44
# debug builds with our --debug=make_global... we don't hang forever.