diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/grant_kill.test | |
parent | Initial commit. (diff) | |
download | mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/grant_kill.test')
-rw-r--r-- | mysql-test/main/grant_kill.test | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/mysql-test/main/grant_kill.test b/mysql-test/main/grant_kill.test new file mode 100644 index 00000000..75a25743 --- /dev/null +++ b/mysql-test/main/grant_kill.test @@ -0,0 +1,91 @@ +-- source include/not_embedded.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-21743 Split up SUPER privilege to smaller privileges +--echo # +--disable_service_connection + +--let $count_sessions=1 + +--echo # +--echo # Test that KILL is not allowed without CONNECTION ADMIN or SUPER +--echo # + +CREATE USER foo@localhost; +GRANT SELECT ON *.* TO foo@localhost; +CREATE USER bar@localhost; +GRANT ALL PRIVILEGES ON *.* TO bar@localhost; +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,,) +SELECT user FROM information_schema.processlist ORDER BY user; +--replace_result $id ID +--error ER_KILL_DENIED_ERROR +--eval KILL $id +--disconnect foo +--disconnect bar +--connection default +--source include/wait_until_count_sessions.inc +DROP USER foo@localhost; +DROP USER bar@localhost; + +--echo # +--echo # Test that KILL is allowed with CONNECTION ADMIN +--echo # + +CREATE USER foo@localhost; +GRANT SELECT ON *.* TO foo@localhost; +CREATE USER bar@localhost; +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,,) +SELECT user FROM information_schema.processlist ORDER BY user; +--replace_result $id ID +--eval KILL $id +--connection default +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where user = "foo"; +--source include/wait_condition.inc +--disconnect foo +--disconnect bar +--source include/wait_until_count_sessions.inc +DROP USER foo@localhost; +DROP USER bar@localhost; + +--echo # +--echo # Test that KILL is allowed with SUPER +--echo # + +CREATE USER foo@localhost; +GRANT SELECT ON *.* TO foo@localhost; +CREATE USER bar@localhost; +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,,) +SELECT user FROM information_schema.processlist ORDER BY user; +--replace_result $id ID +--eval KILL $id +--connection default +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where user = "foo"; +--source include/wait_condition.inc +--disconnect foo +--disconnect bar +--source include/wait_until_count_sessions.inc +DROP USER foo@localhost; +DROP USER bar@localhost; + +--enable_service_connection + +--echo # +--echo # End of 10.5 tests +--echo # |