~vkolesnikov/pbxt/pbxt-07-diskfull

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/t/flush_read_lock_kill.test

  • Committer: paul-mccullagh
  • Date: 2006-10-23 09:14:04 UTC
  • Revision ID: paul-mccullagh-918861e03d351978a9541168a96e58cc826734ee
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
# skipped.
 
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).
 
9
 
 
10
# This also won't work with the embedded server test
 
11
-- source include/not_embedded.inc
 
12
 
 
13
-- source include/have_debug.inc
 
14
 
 
15
connect (con1,localhost,root,,);
 
16
connect (con2,localhost,root,,);
 
17
connection con1;
 
18
 
 
19
--disable_warnings
 
20
drop table if exists t1;
 
21
--enable_warnings
 
22
create table t1 (kill_id int);
 
23
insert into t1 values(connection_id());
 
24
 
 
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
 
29
 
 
30
connection con1;
 
31
send flush tables with read lock;
 
32
 
 
33
# kill con1
 
34
connection con2;
 
35
select ((@id := kill_id) - kill_id) from t1; 
 
36
 
 
37
--sleep 2 # leave time for FLUSH to block
 
38
kill connection @id;
 
39
 
 
40
connection con1;
 
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.
 
45
--error 0,1053,2013
 
46
reap;
 
47
 
 
48
connection con2;
 
49
drop table t1;