summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-10-02 22:14:21 +0200
committerSergei Golubchik <serg@mariadb.org>2022-10-02 22:14:21 +0200
commit900d7bf3604e7ba265f06d96f76a049dc3c4c9af (patch)
treec447b67842760bdc3ccae31aebb987fee4071842 /sql/sql_acl.cc
parent2ab52cc0e5c3cc792608a518625a08e6d3734ce4 (diff)
parent3a2116241b128b811ee2455845ff9710da3115ac (diff)
downloadmariadb-git-900d7bf3604e7ba265f06d96f76a049dc3c4c9af.tar.gz
Merge branch '10.5' into 10.6
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index c77fbfceaa1..ba3cafa69ab 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -7124,7 +7124,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
table_list->grant.want_privilege);
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
command, thd->security_ctx->priv_user,
- thd->security_ctx->host_or_ip, table_list->alias.str);
+ thd->security_ctx->host_or_ip, table_list->db.str,
+ table_list->alias.str);
DBUG_RETURN(-1);
}
}
@@ -8176,8 +8177,8 @@ bool grant_reload(THD *thd)
@see check_table_access
@note
- This functions assumes that either number of tables to be inspected
- by it is limited explicitly (i.e. is is not UINT_MAX) or table list
+ This function assumes that either number of tables to be inspected
+ by it is limited explicitly (i.e. is not UINT_MAX) or table list
used and thd->lex->query_tables_own_last value correspond to each
other (the latter should be either 0 or point to next_global member
of one of elements of this table list).
@@ -8382,7 +8383,7 @@ err:
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
command,
sctx->priv_user,
- sctx->host_or_ip,
+ sctx->host_or_ip, tl ? tl->db.str : "unknown",
tl ? tl->get_table_name() : "unknown");
}
DBUG_RETURN(TRUE);
@@ -8566,7 +8567,7 @@ bool check_grant_all_columns(THD *thd, privilege_t want_access_arg,
Security_context *sctx= thd->security_ctx;
privilege_t want_access(NO_ACL);
const char *table_name= NULL;
- const char* db_name;
+ const char* db_name= NULL;
GRANT_INFO *grant;
GRANT_TABLE *UNINIT_VAR(grant_table);
GRANT_TABLE *UNINIT_VAR(grant_table_role);
@@ -8655,7 +8656,7 @@ err:
if (using_column_privileges)
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
command, sctx->priv_user,
- sctx->host_or_ip, table_name);
+ sctx->host_or_ip, db_name, table_name);
else
my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0),
command,