diff options
Diffstat (limited to 'storage/innobase/row/row0trunc.cc')
-rw-r--r-- | storage/innobase/row/row0trunc.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/storage/innobase/row/row0trunc.cc b/storage/innobase/row/row0trunc.cc index 648a83f7dc6..5e512c602e6 100644 --- a/storage/innobase/row/row0trunc.cc +++ b/storage/innobase/row/row0trunc.cc @@ -748,14 +748,10 @@ public: Constructor @param[in,out] table Table to truncate + @param[in,out] trx dictionary transaction @param[in] noredo whether to disable redo logging */ - DropIndex(dict_table_t* table, bool noredo) - : - Callback(table->id, noredo), - m_table(table) - { - /* No op */ - } + DropIndex(dict_table_t* table, trx_t* trx, bool noredo) + : Callback(table->id, noredo), m_trx(trx), m_table(table) {} /** @param mtr mini-transaction covering the read @@ -764,8 +760,10 @@ public: dberr_t operator()(mtr_t* mtr, btr_pcur_t* pcur) const; private: + /** dictionary transaction */ + trx_t* const m_trx; /** Table to be truncated */ - dict_table_t* m_table; + dict_table_t* const m_table; }; /** Callback to create the indexes during TRUNCATE */ @@ -907,7 +905,7 @@ DropIndex::operator()(mtr_t* mtr, btr_pcur_t* pcur) const { rec_t* rec = btr_pcur_get_rec(pcur); - bool freed = dict_drop_index_tree(rec, pcur, mtr); + bool freed = dict_drop_index_tree(rec, pcur, m_trx, mtr); #ifdef UNIV_DEBUG { @@ -1122,7 +1120,7 @@ row_truncate_rollback( it can be recovered using drop/create sequence. */ dict_table_x_lock_indexes(table); - DropIndex dropIndex(table, no_redo); + DropIndex dropIndex(table, trx, no_redo); SysIndexIterator().for_each(dropIndex); @@ -1936,7 +1934,7 @@ dberr_t row_truncate_table_for_mysql(dict_table_t* table, trx_t* trx) indexes) */ if (!dict_table_is_temporary(table)) { - DropIndex dropIndex(table, no_redo); + DropIndex dropIndex(table, trx, no_redo); err = SysIndexIterator().for_each(dropIndex); |