1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

cannot use lex->grant_user= &current_user, where LEX_USER current_user is a global constant,

because parser might modify the lex->user (e.g. set lex->user-password).
switch to use LEX_STRING current_user string, and also change other similar constants
to be LEX_STRING's for consistency.
This commit is contained in:
Sergei Golubchik
2013-10-18 08:17:56 -07:00
parent cdb5510204
commit 06e16b8c97
8 changed files with 67 additions and 67 deletions

View File

@ -4004,11 +4004,11 @@ end_with_restore_list:
if (grant_user->user.str &&
!strcmp(thd->security_ctx->priv_user, grant_user->user.str))
grant_user= &current_user;
grant_user->user= current_user;
if (grant_user == &current_user ||
grant_user == &current_role ||
grant_user == &current_user_and_current_role ||
if (grant_user->user.str == current_user.str ||
grant_user->user.str == current_role.str ||
grant_user->user.str == current_user_and_current_role.str ||
!check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0))
{
res = mysql_show_grants(thd, grant_user);
@ -7757,7 +7757,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
LEX_USER *get_current_user(THD *thd, LEX_USER *user)
{
if (user == &current_user) // current_user
if (user->user.str == current_user.str) // current_user
return create_default_definer(thd);
return user;