summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@ibmvm>2009-10-07 20:39:57 +0400
committerAlexander Nozdrin <alik@ibmvm>2009-10-07 20:39:57 +0400
commit9384835087d71b77ef1ee0f197704060c713af2c (patch)
tree36172354a44f415d1a716da83486600d055b7305 /sql/sql_db.cc
parent1733a974b4811f439806d5b6cfc388462b9bd675 (diff)
downloadmariadb-git-9384835087d71b77ef1ee0f197704060c713af2c.tar.gz
A backport of patch for Bug#26704.
Original revision is from mysql-6.0-codebase: revno: 2630.3.1 committer: Alexander Nozdrin <alik@mysql.com> branch nick: 6.0-rt-bug26704 timestamp: Thu 2008-05-29 21:04:06 +0400 message: A fix for Bug#26704: Failing DROP DATABASE brings mysql-client out of sync. The problem was that we changed current database w/o caring whether it was dropped successfully or not. The fix is not to change current database if we failed to drop it.
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index bcc8fcf54fc..604a2643f43 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1027,7 +1027,7 @@ exit:
SELECT DATABASE() in the future). For this we free() thd->db and set
it to 0.
*/
- if (thd->db && !strcmp(thd->db, db))
+ if (thd->db && !strcmp(thd->db, db) && error == 0)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
start_waiting_global_read_lock(thd);