summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 04bec87ca13..e66a2600446 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1402,12 +1402,8 @@ bool mysqld_show_create_db(THD *thd, LEX_CSTRING *dbname,
if (test_all_bits(sctx->master_access, DB_ACLS))
db_access=DB_ACLS;
else
- {
- db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname->str, 0) |
+ db_access= acl_get_all3(sctx, dbname->str, FALSE) |
sctx->master_access;
- if (sctx->priv_role[0])
- db_access|= acl_get("", "", sctx->priv_role, dbname->str, 0);
- }
if (!(db_access & DB_ACLS) && check_grant_db(thd,dbname->str))
{
@@ -5304,7 +5300,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
&thd->col_access, NULL, 0, 1) ||
(!thd->col_access && check_grant_db(thd, db_name->str))) ||
sctx->master_access & (DB_ACLS | SHOW_DB_ACL) ||
- acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0))
+ acl_get_all3(sctx, db_name->str, 0))
#endif
{
Dynamic_array<LEX_CSTRING*> table_names(PSI_INSTRUMENT_MEM);
@@ -5504,9 +5500,7 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond)
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (sctx->master_access & (DB_ACLS | SHOW_DB_ACL) ||
- acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, false) ||
- (sctx->priv_role[0] ?
- acl_get("", "", sctx->priv_role, db_name->str, false) : NO_ACL) ||
+ acl_get_all3(sctx, db_name->str, false) ||
!check_grant_db(thd, db_name->str))
#endif
{