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);
14
set @my_barrier= "barrier";
15
SELECT USER_BARRIER_NAME FROM DATA_DICTIONARY.USER_BARRIERS WHERE USER_BARRIER_NAME=@my_barrier;
16
SELECT SIGNAL(@my_barrier);
18
SELECT EXECUTE(A) FROM t1;
19
SELECT WAIT_UNTIL(@my_barrier, 3);
21
### Now lets see what the processlist shows.
22
SELECT USER,INFO FROM DATA_DICTIONARY.PROCESSLIST ORDER BY ID;
23
SELECT SIGNAL(@my_barrier);