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

patch for BUG#4680 - drop database breaking replication if there were extra files

in the database directory on the master


mysql-test/r/rpl_drop_db.result:
  New BitKeeper file ``mysql-test/r/rpl_drop_db.result''
mysql-test/t/rpl_drop_db.test:
  New BitKeeper file ``mysql-test/t/rpl_drop_db.test''
This commit is contained in:
unknown
2005-08-03 18:08:20 -06:00
parent bbb2bfe1b7
commit ec657e8d2a
5 changed files with 129 additions and 7 deletions

View File

@@ -156,7 +156,8 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
int mysql_rm_table_part2_with_lock(THD *thd,
TABLE_LIST *tables, bool if_exists,
bool drop_temporary, bool dont_log_query)
bool drop_temporary, bool dont_log_query,
List<String>* dropped_tables)
{
int error;
thd->mysys_var->current_mutex= &LOCK_open;
@@ -165,6 +166,23 @@ int mysql_rm_table_part2_with_lock(THD *thd,
error=mysql_rm_table_part2(thd,tables, if_exists, drop_temporary,
dont_log_query);
/*
For now we assume that if we got success all the tables in the list
were actually dropped, otherwise, assume none were dropped.
TODO: fix it to work with a partial drop - extremely rare case, but
can happen.
*/
if (!error && dropped_tables)
{
TABLE_LIST* tbl;
for (tbl= tables; tbl; tbl= tbl->next)
{
String *dropped_table= new (thd->mem_root)
String(tbl->real_name,&my_charset_latin1);
dropped_tables->push_back(dropped_table);
}
}
pthread_mutex_unlock(&LOCK_open);