summaryrefslogtreecommitdiff
path: root/mysql-test/main/grant5.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/grant5.result')
-rw-r--r--mysql-test/main/grant5.result36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index 972131a24b7..9f6eb583e91 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -39,6 +39,42 @@ disconnect u1;
drop user u1@localhost;
drop database mysqltest1;
#
+# MDEV-22313: Neither SHOW CREATE USER nor SHOW GRANTS prints a user's default role
+#
+CREATE ROLE test_role;
+CREATE USER test_user;
+GRANT test_role TO test_user;
+SET DEFAULT ROLE test_role FOR test_user;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
+SET DEFAULT ROLE test_role FOR 'test_user'@'%'
+SET DEFAULT ROLE NONE for test_user;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
+connect test_user, localhost, test_user;
+SET ROLE test_role;
+SET DEFAULT ROLE test_role;
+SHOW GRANTS;
+Grants for test_user@%
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_role`
+SET DEFAULT ROLE test_role FOR 'test_user'@'%'
+SET DEFAULT ROLE NONE;
+SHOW GRANTS;
+Grants for test_user@%
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_role`
+disconnect test_user;
+connection default;
+DROP USER test_user;
+DROP ROLE test_role;
+#
# MDEV-20076: SHOW GRANTS does not quote role names properly
#
create role 'role1';