From 6b9f24be88ec99f9524c9f22f1ba3ee9d7266308 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Thu, 9 Jan 2003 23:21:20 +0200 Subject: [PATCH] changing a bit SHOW GRANTS to display empty row in global table. --- mysql-test/r/grant.result | 6 ++++++ sql/sql_acl.cc | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index a1a0c91a575..32edf874400 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -22,6 +22,7 @@ GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant select on mysqltest.* to mysqltest_1@localhost require NONE; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; show grants for mysqltest_1@localhost; @@ -37,23 +38,28 @@ flush privileges; grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' flush privileges; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; flush privileges; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 1f8f25e5fb8..0d434c38e3a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2762,8 +2762,6 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) VOID(pthread_mutex_lock(&acl_cache->lock)); /* Add first global access grants */ - if (acl_user->access || acl_user->password || - acl_user->ssl_type != SSL_TYPE_NONE) { want_access=acl_user->access; String global(buff,sizeof(buff));