summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-10-18 08:17:56 -0700
committerSergei Golubchik <sergii@pisem.net>2013-10-18 08:17:56 -0700
commit06e16b8c97209ea3c913d0de9e956fe89b09ebd7 (patch)
treec743f8bf7dd5e102c7720edd2fc804a492f4fd9a /sql/set_var.cc
parentcdb5510204f7d04242bb11e8d97509627af8afc0 (diff)
downloadmariadb-git-06e16b8c97209ea3c913d0de9e956fe89b09ebd7.tar.gz
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.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 33c360ae785..4eb53dd04f4 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -841,12 +841,9 @@ int set_var_password::check(THD *thd)
user->host.length= strlen(thd->security_ctx->priv_host);
}
else
- {
- user->host.str= (char *)"%";
- user->host.length= 1;
- }
+ user->host= host_not_specified;
}
- if (!user->user.str)
+ if (user->user.str == current_user.str)
{
DBUG_ASSERT(thd->security_ctx->user);
user->user.str= (char *) thd->security_ctx->user;