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; ...@@ -14,7 +14,6 @@ GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost; REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
connect foo,localhost,foo,,; connect foo,localhost,foo,,;
connect bar,localhost,bar,,; connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
user user
bar bar
...@@ -36,7 +35,6 @@ CREATE USER bar@localhost; ...@@ -36,7 +35,6 @@ CREATE USER bar@localhost;
GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost; GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
connect foo,localhost,foo,,; connect foo,localhost,foo,,;
connect bar,localhost,bar,,; connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
user user
bar bar
...@@ -46,7 +44,6 @@ KILL ID; ...@@ -46,7 +44,6 @@ KILL ID;
connection default; connection default;
disconnect foo; disconnect foo;
disconnect bar; disconnect bar;
connection default;
DROP USER foo@localhost; DROP USER foo@localhost;
DROP USER bar@localhost; DROP USER bar@localhost;
# #
...@@ -58,7 +55,6 @@ CREATE USER bar@localhost; ...@@ -58,7 +55,6 @@ CREATE USER bar@localhost;
GRANT PROCESS, SUPER ON *.* TO bar@localhost; GRANT PROCESS, SUPER ON *.* TO bar@localhost;
connect foo,localhost,foo,,; connect foo,localhost,foo,,;
connect bar,localhost,bar,,; connect bar,localhost,bar,,;
connection bar;
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
user user
bar bar
...@@ -68,7 +64,6 @@ KILL ID; ...@@ -68,7 +64,6 @@ KILL ID;
connection default; connection default;
disconnect foo; disconnect foo;
disconnect bar; disconnect bar;
connection default;
DROP USER foo@localhost; DROP USER foo@localhost;
DROP USER bar@localhost; DROP USER bar@localhost;
# #
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
--echo # MDEV-21743 Split up SUPER privilege to smaller privileges --echo # MDEV-21743 Split up SUPER privilege to smaller privileges
--echo # --echo #
--let $count_sessions=1
--echo # --echo #
--echo # Test that KILL is not allowed without CONNECTION ADMIN or SUPER --echo # Test that KILL is not allowed without CONNECTION ADMIN or SUPER
--echo # --echo #
...@@ -20,7 +22,6 @@ REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost; ...@@ -20,7 +22,6 @@ REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
--connect (foo,localhost,foo,,) --connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`; let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,) --connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID --replace_result $id ID
--error ER_KILL_DENIED_ERROR --error ER_KILL_DENIED_ERROR
...@@ -28,6 +29,7 @@ SELECT user FROM information_schema.processlist ORDER BY user; ...@@ -28,6 +29,7 @@ SELECT user FROM information_schema.processlist ORDER BY user;
--disconnect foo --disconnect foo
--disconnect bar --disconnect bar
--connection default --connection default
--source include/wait_until_count_sessions.inc
DROP USER foo@localhost; DROP USER foo@localhost;
DROP USER bar@localhost; DROP USER bar@localhost;
...@@ -42,7 +44,6 @@ GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost; ...@@ -42,7 +44,6 @@ GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
--connect (foo,localhost,foo,,) --connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`; let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,) --connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID --replace_result $id ID
--eval KILL $id --eval KILL $id
...@@ -53,7 +54,7 @@ let $wait_condition= ...@@ -53,7 +54,7 @@ let $wait_condition=
--source include/wait_condition.inc --source include/wait_condition.inc
--disconnect foo --disconnect foo
--disconnect bar --disconnect bar
--connection default --source include/wait_until_count_sessions.inc
DROP USER foo@localhost; DROP USER foo@localhost;
DROP USER bar@localhost; DROP USER bar@localhost;
...@@ -68,7 +69,6 @@ GRANT PROCESS, SUPER ON *.* TO bar@localhost; ...@@ -68,7 +69,6 @@ GRANT PROCESS, SUPER ON *.* TO bar@localhost;
--connect (foo,localhost,foo,,) --connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`; let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,) --connect (bar,localhost,bar,,)
--connection bar
SELECT user FROM information_schema.processlist ORDER BY user; SELECT user FROM information_schema.processlist ORDER BY user;
--replace_result $id ID --replace_result $id ID
--eval KILL $id --eval KILL $id
...@@ -79,7 +79,7 @@ let $wait_condition= ...@@ -79,7 +79,7 @@ let $wait_condition=
--source include/wait_condition.inc --source include/wait_condition.inc
--disconnect foo --disconnect foo
--disconnect bar --disconnect bar
--connection default --source include/wait_until_count_sessions.inc
DROP USER foo@localhost; DROP USER foo@localhost;
DROP USER bar@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