summaryrefslogtreecommitdiff
path: root/mysql-test/main/mysql_upgrade_to_100502.test
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-11-16 14:31:44 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-11-16 14:31:44 +0530
commit6da68049b5d28246c5773fc2caee7bef6c6fc68f (patch)
tree01851367f02fe3bd29dcd4425bc86f5e81ea4599 /mysql-test/main/mysql_upgrade_to_100502.test
parent1edd224372d9399a43a21c5c387aff84512f55e5 (diff)
downloadmariadb-git-6da68049b5d28246c5773fc2caee7bef6c6fc68f.tar.gz
MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
Add a new privilege "SLAVE MONITOR" which will grant user the permission to execute "SHOW SLAVE STATUS" and "SHOW RELAYLOG EVENTS" commands. SHOW SLAVE STATUS requires either SLAVE MONITOR/SUPER SHOW RELAYLOG EVENTS requires SLAVE MONITOR privilege.
Diffstat (limited to 'mysql-test/main/mysql_upgrade_to_100502.test')
-rw-r--r--mysql-test/main/mysql_upgrade_to_100502.test65
1 files changed, 65 insertions, 0 deletions
diff --git a/mysql-test/main/mysql_upgrade_to_100502.test b/mysql-test/main/mysql_upgrade_to_100502.test
index b03fb14fe08..b5a44080f17 100644
--- a/mysql-test/main/mysql_upgrade_to_100502.test
+++ b/mysql-test/main/mysql_upgrade_to_100502.test
@@ -25,6 +25,33 @@ CREATE USER user_super_replslave@localhost;
GRANT SUPER, REPLICATION SLAVE ON *.* TO user_super_replslave@localhost;
SHOW GRANTS FOR user_super_replslave@localhost;
+--echo #
+--echo # MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
+--echo #
+
+--echo #
+--echo # Users with privilege SUPER prior to 10.5 should successfully execute
+--echo # SHOW SLAVE STATUS command
+--echo #
+CREATE USER user_replsuper@localhost;
+GRANT SUPER ON *.* TO user_replsuper@localhost;
+SHOW GRANTS FOR user_replsuper@localhost;
+
+--echo #
+--echo # Users with privilege REPLICATION CLIENT prior to 10.5 should successfully execute
+--echo # SHOW SLAVE STATUS command
+--echo #
+CREATE USER user_replclient@localhost;
+GRANT REPLICATION CLIENT ON *.* TO user_replclient@localhost;
+SHOW GRANTS FOR user_replclient@localhost;
+
+--echo #
+--echo # Users with privilege REPLICATION SLAVE prior to 10.5 should successfully execute
+--echo # SHOW RELAYLOG EVENTS command
+--echo #
+CREATE USER user_replslave@localhost;
+GRANT REPLICATION SLAVE ON *.* TO user_replslave@localhost;
+SHOW GRANTS FOR user_replslave@localhost;
--echo # mysql_upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
@@ -46,6 +73,44 @@ SHOW GRANTS FOR user_super@localhost;
--echo #
SHOW GRANTS FOR user_super_replslave@localhost;
+--echo #
+--echo # MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
+--echo #
+
+--echo #
+--echo # Should automatically get BINLOG MONITOR and REPLICA MONITOR
+--echo #
+SHOW GRANTS FOR user_replclient@localhost;
+
+--echo #
+--echo # Should automatically get REPLICA MONITOR
+--echo #
+SHOW GRANTS FOR user_replslave@localhost;
+
+--connect (con1,localhost,user_super_replslave,,test)
+--connection con1
+--disable_result_log
+SHOW SLAVE STATUS;
+--enable_result_log
+--disconnect con1
+
+--connect (con1,localhost,user_replclient,,test)
+--connection con1
+--disable_result_log
+SHOW SLAVE STATUS;
+--enable_result_log
+--disconnect con1
+
+--connect (con1,localhost,user_replslave,,test)
+--connection con1
+--disable_ps_protocol
+--disable_result_log
+SHOW RELAYLOG EVENTS;
+--enable_result_log
+--enable_ps_protocol
+--disconnect con1
+
+--connection default
SELECT
json_value(Priv, '$.version_id'),
json_value(Priv, '$.access'),