Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions mysql-test/main/kill-2.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
create user foo@'127.0.0.1';
connect con1,127.0.0.1,foo,,;
connection default;
select user from information_schema.processlist;
select user from information_schema.processlist where id=$con1_id;
user
foo
root
kill user foo@'127.0.0.1';
drop user foo@'127.0.0.1';
#
Expand All @@ -28,11 +27,11 @@ Id User Host db Command Time State Info Progress
kill user a;
kill user x;
connection a;
show processlist;
Id User Host db Command Time State Info Progress
# root # test # # # # #
# a # NULL # # # # #
# b # test # # # # #
select user from information_schema.processlist where id in (connection_id(), $b_id, $default_id) order by user;
user
a
b
root
kill user b;
ERROR HY000: Operation KILL USER failed for b@%
connection default;
Expand Down
8 changes: 5 additions & 3 deletions mysql-test/main/kill-2.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
create user foo@'127.0.0.1';

--connect (con1,127.0.0.1,foo,,)
let $con1_id= `select connection_id()`;

--connection default
select user from information_schema.processlist;
evalp select user from information_schema.processlist where id=$con1_id;
kill user foo@'127.0.0.1';

let $wait_condition=
Expand All @@ -31,20 +32,21 @@ drop user foo@'127.0.0.1';
--echo #
--echo # KILL USER and missing privileges
--echo #
let $default_id= `select connection_id()`;
create user a@'127.0.0.1';
create user b@'127.0.0.1';
grant process on *.* to a@'127.0.0.1';
grant select on *.* to b@'127.0.0.1';
--connect a,127.0.0.1,a
show grants;
--connect b,127.0.0.1,b
let $b_id= `select connection_id()`;
--replace_column 1 # 3 # 5 # 6 # 9 #
show processlist;
kill user a; # existing connection, but not visible to current_user
kill user x; # not existing connection
--connection a
--replace_column 1 # 3 # 5 # 6 # 7 # 8 # 9 #
show processlist;
evalp select user from information_schema.processlist where id in (connection_id(), $b_id, $default_id) order by user;
--error ER_KILL_DENIED_ERROR
kill user b;
--connection default
Expand Down