~drizzle-trunk/drizzle/development

1976.7.2 by Brian Aker
Adding execute command to go along with main command.
1
# we are going to have everything owned by a particular connection
2
connect (barrier_owner,localhost,root,,);
3
connection barrier_owner;
4
set @my_barrier= "barrier";
5
SELECT CREATE_BARRIER(@my_barrier);
6
set @my_barrier= "barrier";
7
SELECT CREATE_BARRIER(@my_barrier);
8
CREATE TABLE t1 (A VARCHAR(150));
9
SET @execute= "SELECT WAIT('barrier')";
10
INSERT INTO t1 VALUES (@execute), (@execute), (@execute);
11
12
13
connection default;
14
set @my_barrier= "barrier";
1996.1.1 by Brian Aker
Update name usage for user defined objects.
15
SELECT USER_BARRIER_NAME FROM DATA_DICTIONARY.USER_DEFINED_BARRIERS WHERE USER_BARRIER_NAME=@my_barrier;
1976.7.2 by Brian Aker
Adding execute command to go along with main command.
16
SELECT SIGNAL(@my_barrier);
17
18
SELECT EXECUTE(A) FROM t1;
19
SELECT WAIT_UNTIL(@my_barrier, 3);
20
 
21
### Now lets see what the processlist shows.
22
SELECT USER,INFO FROM DATA_DICTIONARY.PROCESSLIST ORDER BY ID;
23
SELECT SIGNAL(@my_barrier);
1976.7.3 by Brian Aker
Extended the test to call kill() on its own children.
24
25
26
#
27
# We now repeat the test above, but we will check that we can kill the
28
# children we created.
29
#
30
TRUNCATE t1;
31
# Now we are going to add a way to identify our children.
32
SET @execute= "SELECT WAIT('barrier'), 2";
33
INSERT INTO t1 VALUES (@execute), (@execute), (@execute);
34
35
SELECT EXECUTE(A) FROM t1;
36
SELECT WAIT_UNTIL(@my_barrier, 3);
37
38
### Now lets see what the processlist shows.
39
SELECT USER,INFO FROM DATA_DICTIONARY.PROCESSLIST ORDER BY ID;
40
# Kill!
41
SELECT IF(KILL(ID), "YES", "NO") FROM DATA_DICTIONARY.PROCESSLIST WHERE INFO LIKE "%2";
42
SELECT SIGNAL(@my_barrier);
43
44
DROP TABLE t1;