summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2012-02-28 21:41:55 +0200
committerMarko Mäkelä <marko.makela@oracle.com>2012-02-28 21:41:55 +0200
commit26ed79ec14a54a9d8e7bad48090889fd9e83f1ea (patch)
treeb9969f018c7d8ea083b73c012912c8f680c07f1c
parent0664bb7cd0c837ed168c7f8223157e3c5ce0a03c (diff)
downloadmariadb-git-26ed79ec14a54a9d8e7bad48090889fd9e83f1ea.tar.gz
Fix a mistake in the Bug#12861864 fix.
row_drop_table_for_mysql(): Really flag the indexes unavailable before starting to drop the table.
-rw-r--r--storage/innodb_plugin/row/row0mysql.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
index 5f8fc6a903b..d67a7b29e1c 100644
--- a/storage/innodb_plugin/row/row0mysql.c
+++ b/storage/innodb_plugin/row/row0mysql.c
@@ -3220,6 +3220,18 @@ check_next_foreign:
trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
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
query graphs needed in deleting the dictionary data from system
tables in Innobase. Deleting a row from SYS_INDEXES table also
@@ -3306,18 +3318,6 @@ check_next_foreign:
"END;\n"
, 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) {
ibool is_temp;
const char* name_or_path;