1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

row0mysql.c, sql_db.cc:

Try to make sure DROP DATABASE does not cause a deadlock because we now let InnoDB wait MySQL does not have open handles to tables we drop
This commit is contained in:
heikki@hundin.mysql.fi
2002-02-14 03:45:45 +02:00
parent d76fcdc5e9
commit c70be0113b
2 changed files with 25 additions and 3 deletions

View File

@@ -164,8 +164,6 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
}
remove_db_from_cache(db);
ha_drop_database(path);
if ((deleted=mysql_rm_known_files(thd, dirp, path,0)) >= 0)
{
if (!thd->query)
@@ -191,6 +189,14 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
exit:
VOID(pthread_mutex_unlock(&LOCK_open));
VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
/* It seems MySQL may call this function when there still are queries
running on tables of the database. Since InnoDB waits until the
queries have ended, we have to call ha_drop_database outside
the above two mutexes to avoid deadlocks. */
ha_drop_database(path);
DBUG_VOID_RETURN;
}