summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-05-13 18:58:26 +0300
committerunknown <monty@narttu.mysql.fi>2003-05-13 18:58:26 +0300
commitdc1e55f8194db83e7a40dea5bf49e9fef970826c (patch)
treeb0c44d624533c05fb3586c52901c5d00fe1f3186 /sql/sql_parse.cc
parent4ccf66df87bfe9290d686e7abd585d3ffe1c1370 (diff)
downloadmariadb-git-dc1e55f8194db83e7a40dea5bf49e9fef970826c.tar.gz
Fix for UNION and LEFT JOIN (Bug #386)
Fixed wrong logging of Access denied error (Bug #398) include/my_global.h: Fix for QNX mysql-test/r/union.result: new test case mysql-test/t/union.test: Test of bug in union and left join mysys/my_seek.c: Safety fix to find out when pos gets a wrong value sql/field.h: Fix for UNION and LEFT JOIN sql/mysql_priv.h: Fix for UNION and LEFT JOIN sql/sql_base.cc: Fix for UNION and LEFT JOIN sql/sql_insert.cc: Fix for UNION and LEFT JOIN sql/sql_parse.cc: Fixed wrong logging of Access denied error sql/sql_union.cc: Fix for UNION and LEFT JOIN sql/sql_update.cc: Fix for UNION and LEFT JOIN
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 73983bc03b1..7496d05be50 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -196,9 +196,17 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
thd->db=0;
thd->db_length=0;
USER_RESOURCES ur;
+ char tmp_passwd[SCRAMBLE_LENGTH];
if (passwd[0] && strlen(passwd) != SCRAMBLE_LENGTH)
return 1;
+ /*
+ Move password to temporary buffer as it may be stored in communication
+ buffer
+ */
+ strmov(tmp_passwd, passwd);
+ passwd= tmp_passwd; // Use local copy
+
if (!(thd->user = my_strdup(user, MYF(0))))
{
send_error(net,ER_OUT_OF_RESOURCES);
@@ -264,6 +272,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
}
else
send_ok(net); // Ready to handle questions
+ thd->password= test(passwd[0]); // Remember for error messages
return 0; // ok
}
@@ -617,7 +626,6 @@ check_connections(THD *thd)
net->read_timeout=(uint) thd->variables.net_read_timeout;
if (check_user(thd,COM_CONNECT, user, passwd, db, 1))
return (-1);
- thd->password=test(passwd[0]);
return 0;
}
@@ -1007,7 +1015,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
decrease_user_connections(save_uc);
x_free((gptr) save_db);
x_free((gptr) save_user);
- thd->password=test(passwd[0]);
break;
}