|
|
|
@ -2676,6 +2676,10 @@ loop: |
|
|
|
return(n_tables + n_tables_dropped); |
|
|
|
} |
|
|
|
|
|
|
|
DBUG_EXECUTE_IF("row_drop_tables_in_background_sleep", |
|
|
|
os_thread_sleep(5000000); |
|
|
|
); |
|
|
|
|
|
|
|
table = dict_table_open_on_name(drop->table_name, FALSE, FALSE, |
|
|
|
DICT_ERR_IGNORE_NONE); |
|
|
|
|
|
|
|
@ -2686,6 +2690,16 @@ loop: |
|
|
|
goto already_dropped; |
|
|
|
} |
|
|
|
|
|
|
|
if (!table->to_be_dropped) { |
|
|
|
/* There is a scenario: the old table is dropped
|
|
|
|
just after it's added into drop list, and new |
|
|
|
table with the same name is created, then we try |
|
|
|
to drop the new table in background. */ |
|
|
|
dict_table_close(table, FALSE, FALSE); |
|
|
|
|
|
|
|
goto already_dropped; |
|
|
|
} |
|
|
|
|
|
|
|
ut_a(!table->can_be_evicted); |
|
|
|
|
|
|
|
dict_table_close(table, FALSE, FALSE); |
|
|
|
@ -3945,6 +3959,13 @@ row_drop_table_for_mysql( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DBUG_EXECUTE_IF("row_drop_table_add_to_background", |
|
|
|
row_add_table_to_background_drop_list(table->name); |
|
|
|
err = DB_SUCCESS; |
|
|
|
goto funct_exit; |
|
|
|
); |
|
|
|
|
|
|
|
/* TODO: could we replace the counter n_foreign_key_checks_running
|
|
|
|
with lock checks on the table? Acquire here an exclusive lock on the |
|
|
|
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that |
|
|
|
@ -4561,6 +4582,19 @@ loop: |
|
|
|
row_mysql_lock_data_dictionary(trx); |
|
|
|
|
|
|
|
while ((table_name = dict_get_first_table_name_in_db(name))) { |
|
|
|
/* Drop parent table if it is a fts aux table, to
|
|
|
|
avoid accessing dropped fts aux tables in information |
|
|
|
scheam when parent table still exists. |
|
|
|
Note: Drop parent table will drop fts aux tables. */ |
|
|
|
char* parent_table_name; |
|
|
|
parent_table_name = fts_get_parent_table_name( |
|
|
|
table_name, strlen(table_name)); |
|
|
|
|
|
|
|
if (parent_table_name != NULL) { |
|
|
|
mem_free(table_name); |
|
|
|
table_name = parent_table_name; |
|
|
|
} |
|
|
|
|
|
|
|
ut_a(memcmp(table_name, name, namelen) == 0); |
|
|
|
|
|
|
|
table = dict_table_open_on_name( |
|
|
|
|