diff options
Diffstat (limited to 'storage/innobase/row/row0undo.cc')
-rw-r--r-- | storage/innobase/row/row0undo.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index 185a71e670b..b65b173fedb 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -279,16 +279,15 @@ row_undo( ? UNDO_NODE_INSERT : UNDO_NODE_MODIFY; } - /* Prevent prepare_inplace_alter_table_dict() from adding - dict_table_t::indexes while we are processing the record. - Recovered transactions are not protected by MDL, and the - secondary index creation is not protected by table locks - for online operation. (A table lock would only be acquired - when committing the ALTER TABLE operation.) */ - const bool locked_data_dict = UNIV_UNLIKELY(trx->is_recovered) - && !trx->dict_operation_lock_mode; - - if (UNIV_UNLIKELY(locked_data_dict)) { + /* Prevent DROP TABLE etc. while we are rolling back this row. + If we are doing a TABLE CREATE or some other dictionary operation, + then we already have dict_operation_lock locked in x-mode. Do not + try to lock again, because that would cause a hang. */ + + const bool locked_data_dict = (trx->dict_operation_lock_mode == 0); + + if (locked_data_dict) { + row_mysql_freeze_data_dictionary(trx); } @@ -304,7 +303,8 @@ row_undo( err = row_undo_mod(node, thr); } - if (UNIV_UNLIKELY(locked_data_dict)) { + if (locked_data_dict) { + row_mysql_unfreeze_data_dictionary(trx); } |