1
1
# Test creating a bunch of connections, and then killing them.
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,,);
2
connect (con1,localhost,bob,,);
3
connect (con2,localhost,bob,,);
4
connect (con3,localhost,bob,,);
5
connect (con4,localhost,bob,,);
6
connect (con5,localhost,bob,,);
9
CREATE TABLE CONNECTIONS SELECT ID FROM DATA_DICTIONARY.PROCESSLIST WHERE ID != CONNECTION_ID();
10
INSERT INTO CONNECTIONS SELECT ID FROM DATA_DICTIONARY.PROCESSLIST WHERE ID != CONNECTION_ID();
15
CREATE TABLE CONNECTIONS SELECT ID FROM DATA_DICTIONARY.PROCESSLIST WHERE ID != CONNECTION_ID() AND username="bob";
11
16
SELECT IF (KILL(id), "YES", "NO") FROM CONNECTIONS ORDER BY RAND();
12
SELECT count(ID) FROM DATA_DICTIONARY.PROCESSLIST WHERE COMMAND != "Killed";
17
SELECT count(ID) FROM DATA_DICTIONARY.PROCESSLIST WHERE COMMAND != "Killed" AND USERNAME="bob";
13
18
DROP TABLE CONNECTIONS;