1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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.
This commit is contained in:
Alexander Nozdrin
2009-10-07 20:39:57 +04:00
parent 1733a974b4
commit 9384835087
3 changed files with 77 additions and 1 deletions

View File

@@ -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);