Commit 92c05a39 authored by Sergei Golubchik's avatar Sergei Golubchik

fix a race condition in the main.grant_kill test

also remove redundant --connection commands
parent df25d67d
......@@ -14,7 +14,6 @@ GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
connect foo,localhost,foo,,;
connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user;
user
bar
......@@ -36,7 +35,6 @@ CREATE USER bar@localhost;
GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
connect foo,localhost,foo,,;
connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user;
user
bar
......@@ -46,7 +44,6 @@ KILL ID;
connection default;
disconnect foo;
disconnect bar;
connection default;
DROP USER foo@localhost;
DROP USER bar@localhost;
#
......@@ -58,7 +55,6 @@ CREATE USER bar@localhost;
GRANT PROCESS, SUPER ON *.* TO bar@localhost;
connect foo,localhost,foo,,;
connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user;
user
bar
......@@ -68,7 +64,6 @@ KILL ID;
connection default;
disconnect foo;
disconnect bar;
connection default;
DROP USER foo@localhost;
DROP USER bar@localhost;
#
......
......@@ -8,6 +8,8 @@
--echo # MDEV-21743 Split up SUPER privilege to smaller privileges
--echo #
--let $count_sessions=1
--echo #
--echo # Test that KILL is not allowed without CONNECTION ADMIN or SUPER
--echo #
......@@ -20,7 +22,6 @@ REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
--connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID
--error ER_KILL_DENIED_ERROR
......@@ -28,6 +29,7 @@ SELECT user FROM information_schema.processlist ORDER BY user;
--disconnect foo
--disconnect bar
--connection default
--source include/wait_until_count_sessions.inc
DROP USER foo@localhost;
DROP USER bar@localhost;
......@@ -42,7 +44,6 @@ GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
--connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID
--eval KILL $id
......@@ -53,7 +54,7 @@ let $wait_condition=
--source include/wait_condition.inc
--disconnect foo
--disconnect bar
--connection default
--source include/wait_until_count_sessions.inc
DROP USER foo@localhost;
DROP USER bar@localhost;
......@@ -68,7 +69,6 @@ GRANT PROCESS, SUPER ON *.* TO bar@localhost;
--connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID
--eval KILL $id
......@@ -79,7 +79,7 @@ let $wait_condition=
--source include/wait_condition.inc
--disconnect foo
--disconnect bar
--connection default
--source include/wait_until_count_sessions.inc
DROP USER foo@localhost;
DROP USER bar@localhost;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment