summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2009-01-08 03:16:22 +0100
committerTimothy Smith <timothy.smith@sun.com>2009-01-08 03:16:22 +0100
commita58bc1bef3c76ebe716f652759771d9ddce2d484 (patch)
tree682658188747bb8fdad7c32d99eadf03a0832bbd /sql/set_var.cc
parent88cd7a98a5b52cd9a7c7568c864f73342f0f4d35 (diff)
parent9b1a87287f829094cec9b17a1401279779893d12 (diff)
downloadmariadb-git-a58bc1bef3c76ebe716f652759771d9ddce2d484.tar.gz
Auto-merge from upstream 5.1-bugteam
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 308735f52f2..07e1528d483 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3549,6 +3549,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;
@@ -3560,6 +3561,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;