summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/grant5.result21
-rw-r--r--mysql-test/t/grant5.test16
2 files changed, 36 insertions, 1 deletions
diff --git a/mysql-test/r/grant5.result b/mysql-test/r/grant5.result
index 01ec063c1d9..3d0bb2757a8 100644
--- a/mysql-test/r/grant5.result
+++ b/mysql-test/r/grant5.result
@@ -33,3 +33,24 @@ grant update on mysqltest1.* to u1@localhost;
update mysqltest1.t1 set id=1 where id=2;
drop user u1@localhost;
drop database mysqltest1;
+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'@'%'
+SHOW GRANTS;
+Grants for root@localhost
+GRANT test_role TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+DROP USER test_user;
+DROP ROLE test_role;
diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test
index 74a69952124..8756648c3e1 100644
--- a/mysql-test/t/grant5.test
+++ b/mysql-test/t/grant5.test
@@ -53,5 +53,19 @@ drop user u1@localhost;
drop database mysqltest1;
#
-# End of 10.1 tests
+# 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;
+SET DEFAULT ROLE NONE for test_user;
+SHOW GRANTS FOR test_user;
+SHOW GRANTS;
+DROP USER test_user;
+DROP ROLE test_role;
+
#
+# End of 10.1 tests
+# \ No newline at end of file