~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/tests/t/kill_wait.test

  • Committer: Brian Aker
  • Date: 2010-11-23 09:35:51 UTC
  • mfrom: (1933.2.13 catalogs)
  • Revision ID: brian@tangent.org-20101123093551-l5m7zhz3m5c4wmlk
Merge in changes for barriers (update for kill, etc).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test creating a barrier with a number
 
2
connect (con1,localhost,root,,);
 
3
connect (con2,localhost,root,,);
 
4
connect (con3,localhost,root,,);
 
5
connect (con4,localhost,root,,);
 
6
connect (con5,localhost,root,,);
 
7
 
 
8
# The default connection will own everything.
 
9
connection default;
 
10
set @count_barrier= "count_barrier";
 
11
set @barrier_limit= 6;
 
12
SELECT create_barrier(@count_barrier, @barrier_limit);
 
13
SELECT if ((SESSION_ID = CONNECTION_ID()), "YES", "NO"), GENERATION, if ((WAITER_LIMIT = @barrier_limit), "YES", "NO") from DATA_DICTIONARY.USER_BARRIERS WHERE USER_BARRIER_NAME=@count_barrier;
 
14
 
 
15
connection con1;
 
16
set @count_barrier= "count_barrier";
 
17
send SELECT wait(@count_barrier), "con1";
 
18
 
 
19
connection con2;
 
20
set @count_barrier= "count_barrier";
 
21
send SELECT wait(@count_barrier), "con2";
 
22
 
 
23
connection con3;
 
24
set @count_barrier= "count_barrier";
 
25
send SELECT wait(@count_barrier), "con3";
 
26
 
 
27
connection con4;
 
28
set @count_barrier= "count_barrier";
 
29
send SELECT wait(@count_barrier), "con4";
 
30
 
 
31
# We don't budge until we know everyone is in place.
 
32
connection con5;
 
33
set @count_barrier= "count_barrier";
 
34
SELECT WAIT_UNTIL(@count_barrier, 4);
 
35
SELECT USER,INFO FROM DATA_DICTIONARY.PROCESSLIST ORDER BY ID;
 
36
SELECT if ((@id:=ID), "YES", "NO") FROM DATA_DICTIONARY.PROCESSLIST WHERE INFO LIKE "%con3%" AND ID != CONNECTION_ID();
 
37
kill QUERY (@id);
 
38
SELECT WAIT_UNTIL(@count_barrier, 3);
 
39
SELECT USER,INFO FROM DATA_DICTIONARY.PROCESSLIST ORDER BY ID;
 
40
SELECT USER_BARRIER_NAME FROM DATA_DICTIONARY.USER_BARRIERS;
 
41
SELECT signal(@count_barrier);