1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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

in the database directory on the master
This commit is contained in:
sasha@asksasha.com
2005-08-03 18:08:20 -06:00
parent bb76e143a3
commit c44fe70d02
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);