1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# Test creating a bunch of connections, and then killing them.
connect (con1,localhost,bob,,);
connect (con2,localhost,bob,,);
connect (con3,localhost,bob,,);
connect (con4,localhost,bob,,);
connect (con5,localhost,bob,,);
connection con1;
connection con2;
connection con3;
connection con4;
connection con5;
connection default;
SELECT COUNT(ID) FROM DATA_DICTIONARY.PROCESSLIST WHERE ID != CONNECTION_ID() AND USERNAME="bob" ORDER BY ID;
SELECT IF(KILL(id), "YES", "NO") FROM DATA_DICTIONARY.PROCESSLIST WHERE ID != CONNECTION_ID() AND USERNAME="bob";
SELECT count(ID) FROM DATA_DICTIONARY.PROCESSLIST WHERE COMMAND != "Killed" AND USERNAME="bob" and ID != CONNECTION_ID();
--error ER_KILL_DENY_SELF_ERROR
SELECT KILL(CONNECTION_ID());
|