summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-04-14 11:56:13 +0200
committerunknown <msvensson@neptunus.(none)>2005-04-14 11:56:13 +0200
commit7b8f4c6da07ee84994ae26b95cb56188e4169d39 (patch)
tree2ddde92ea3ac17c2e2e62b4c4b45395706202f3b /sql/sql_parse.cc
parent5630f0731ab020471108c67e7ae962ba6eaef625 (diff)
downloadmariadb-git-7b8f4c6da07ee84994ae26b95cb56188e4169d39.tar.gz
BUG#9455 mysqladmin status crash the server
- Send error to client when mysql_change_db fails. sql/sql_db.cc: Added a note to comment for mysql_change_db that it will not send any error to the client. sql/sql_parse.cc: Call net_send_error(thd) if mysql_change_db fails. Remove comments claiming that mysql_change_db sends error the the client.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 851be2b3434..bef35dcfd0d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -260,13 +260,15 @@ int check_user(THD *thd, enum enum_server_command command,
#ifdef NO_EMBEDDED_ACCESS_CHECKS
thd->master_access= GLOBAL_ACLS; // Full rights
- /* Change database if necessary: OK or FAIL is sent in mysql_change_db */
+ /* Change database if necessary */
if (db && db[0])
{
thd->db= 0;
thd->db_length= 0;
if (mysql_change_db(thd, db))
{
+ /* Send the error to the client */
+ net_send_error(thd);
if (thd->user_connect)
decrease_user_connections(thd->user_connect);
DBUG_RETURN(-1);
@@ -395,11 +397,13 @@ int check_user(THD *thd, enum enum_server_command command,
check_for_max_user_connections(thd, thd->user_connect))
DBUG_RETURN(-1);
- /* Change database if necessary: OK or FAIL is sent in mysql_change_db */
+ /* Change database if necessary */
if (db && db[0])
{
if (mysql_change_db(thd, db))
{
+ /* Send error to the client */
+ net_send_error(thd);
if (thd->user_connect)
decrease_user_connections(thd->user_connect);
DBUG_RETURN(-1);