summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant5.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-04-21 14:51:37 +0200
committerSergei Golubchik <serg@mariadb.org>2016-04-24 18:15:20 +0200
commitd821dd106ad5086299e3e469f02dfd32eddf04ae (patch)
tree01a0a24d0e7d596dfd8321c182ac26b578c72061 /mysql-test/t/grant5.test
parent23b1b69b101f8f22319a8e661ebe8b4587c435d4 (diff)
downloadmariadb-git-d821dd106ad5086299e3e469f02dfd32eddf04ae.tar.gz
MDEV-9580 SHOW GRANTS FOR <current_user> fails
use get_current_user() to distinguish user name without a hostname and a role name. move privilege checks inside mysql_show_grants() to remove duplicate get_current_user() calls
Diffstat (limited to 'mysql-test/t/grant5.test')
-rw-r--r--mysql-test/t/grant5.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test
index db953d97fb3..14f2fd65020 100644
--- a/mysql-test/t/grant5.test
+++ b/mysql-test/t/grant5.test
@@ -5,3 +5,21 @@
#
--error ER_NONEXISTING_GRANT
SHOW GRANTS FOR root@invalid_host;
+
+#
+# MDEV-9580 SHOW GRANTS FOR <current_user> fails
+#
+create user test;
+create user foo;
+create role foo;
+grant foo to test;
+--connect (conn_1, localhost, test,,)
+set role foo;
+show grants for test; # user
+show grants for foo; # role
+--error ER_DBACCESS_DENIED_ERROR
+show grants for foo@'%'; # user
+--connection default
+drop user test, foo;
+drop role foo;
+