1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-30 11:22:14 +03:00

Fix a mistake in the Bug#12861864 fix.

row_drop_table_for_mysql(): Really flag the indexes unavailable before
starting to drop the table.
This commit is contained in:
Marko Mäkelä
2012-02-28 21:41:55 +02:00
parent 1bd0c9b531
commit e74c9b71ab

View File

@@ -3220,6 +3220,18 @@ check_next_foreign:
trx_set_dict_operation(trx, TRX_DICT_OP_TABLE); trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
trx->table_id = table->id; trx->table_id = table->id;
/* Mark all indexes unavailable in the data dictionary cache
before starting to drop the table. */
for (index = dict_table_get_first_index(table);
index != NULL;
index = dict_table_get_next_index(index)) {
rw_lock_x_lock(dict_index_get_lock(index));
ut_ad(!index->to_be_dropped);
index->to_be_dropped = TRUE;
rw_lock_x_unlock(dict_index_get_lock(index));
}
/* We use the private SQL parser of Innobase to generate the /* We use the private SQL parser of Innobase to generate the
query graphs needed in deleting the dictionary data from system query graphs needed in deleting the dictionary data from system
tables in Innobase. Deleting a row from SYS_INDEXES table also tables in Innobase. Deleting a row from SYS_INDEXES table also
@@ -3306,18 +3318,6 @@ check_next_foreign:
"END;\n" "END;\n"
, FALSE, trx); , FALSE, trx);
/* Mark all indexes unavailable in the data dictionary cache
before starting to drop the table. */
for (index = dict_table_get_first_index(table);
index != NULL;
index = dict_table_get_next_index(index)) {
rw_lock_x_lock(dict_index_get_lock(index));
ut_ad(!index->to_be_dropped);
index->to_be_dropped = TRUE;
rw_lock_x_unlock(dict_index_get_lock(index));
}
switch (err) { switch (err) {
ibool is_temp; ibool is_temp;
const char* name_or_path; const char* name_or_path;