summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2009-01-21 13:45:23 -0500
committerChad MILLER <chad@mysql.com>2009-01-21 13:45:23 -0500
commitf68ccd024a6eeb8c5b6ebf40303bcf580e17d918 (patch)
treef3c1ce77afa4c0b708ac702616710c680ec86ec2 /sql/set_var.cc
parenta2dcb6357984166b0cd8299f88b1d8e1925411dc (diff)
parent8d16eb71b348830529ef9f1f8e528b3d0abd2967 (diff)
downloadmariadb-git-f68ccd024a6eeb8c5b6ebf40303bcf580e17d918.tar.gz
Merge from Tim's 5.0.76-release tree to make 5.0.77 .
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 6aba8a3b5ec..0d9e6b1263e 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -3489,6 +3489,7 @@ int set_var_password::check(THD *thd)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!user->host.str)
{
+ DBUG_ASSERT(thd->security_ctx->priv_host);
if (*thd->security_ctx->priv_host != 0)
{
user->host.str= (char *) thd->security_ctx->priv_host;
@@ -3500,6 +3501,12 @@ int set_var_password::check(THD *thd)
user->host.length= 1;
}
}
+ if (!user->user.str)
+ {
+ DBUG_ASSERT(thd->security_ctx->priv_user);
+ user->user.str= (char *) thd->security_ctx->priv_user;
+ user->user.length= strlen(thd->security_ctx->priv_user);
+ }
/* Returns 1 as the function sends error to client */
return check_change_password(thd, user->host.str, user->user.str,
password, strlen(password)) ? 1 : 0;