Skip to content

Commit

Permalink
Revert "MDEV-6928: Add trx pointer to struct mtr_t"
Browse files Browse the repository at this point in the history
This reverts commit 3486135.

The commit comment ended in the words: "This is needed later."
Apparently the "later" never arrived.
  • Loading branch information
dr-m committed Jan 29, 2018
1 parent 7cdf759 commit d9c77f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
15 changes: 1 addition & 14 deletions storage/innobase/include/mtr0mtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Created 11/26/1995 Heikki Tuuri

/** Start a mini-transaction. */
#define mtr_start(m) (m)->start()
/** Start a mini-transaction. */
#define mtr_start_trx(m, t) (m)->start((t))

/** Start a synchronous mini-transaction */
#define mtr_start_sync(m) (m)->start(true)
Expand Down Expand Up @@ -217,9 +215,6 @@ struct mtr_t {

/** Owning mini-transaction */
mtr_t* m_mtr;

/* Transaction handle */
trx_t* m_trx;
};

mtr_t()
Expand All @@ -239,15 +234,7 @@ struct mtr_t {
/** Start a mini-transaction.
@param sync true if it is a synchronous mini-transaction
@param read_only true if read only mini-transaction */
void start(bool sync = true, bool read_only = false)
{
start(NULL, sync, read_only);
}

/** Start a mini-transaction.
@param sync true if it is a synchronous mini-transaction
@param read_only true if read only mini-transaction */
void start(trx_t* trx, bool sync = true, bool read_only = false);
void start(bool sync = true, bool read_only = false);

/** @return whether this is an asynchronous mini-transaction. */
bool is_async() const
Expand Down
3 changes: 1 addition & 2 deletions storage/innobase/mtr/mtr0mtr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ mtr_write_log(
@param sync true if it is a synchronous mini-transaction
@param read_only true if read only mini-transaction */
void
mtr_t::start(trx_t* trx, bool sync, bool read_only)
mtr_t::start(bool sync, bool read_only)
{
UNIV_MEM_INVALID(this, sizeof(*this));

Expand All @@ -517,7 +517,6 @@ mtr_t::start(trx_t* trx, bool sync, bool read_only)
m_impl.m_undo_space = NULL;
m_impl.m_sys_space = NULL;
m_impl.m_flush_observer = NULL;
m_impl.m_trx = trx;

ut_d(m_impl.m_magic_n = MTR_MAGIC_N);
}
Expand Down
8 changes: 4 additions & 4 deletions storage/innobase/row/row0umod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ row_undo_mod_clust(
/* We may have to modify tree structure: do a pessimistic
descent down the index tree */

mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.start();
if (index->table->is_temporary()) {
mtr.set_log_mode(MTR_LOG_NO_REDO);
} else {
Expand Down Expand Up @@ -366,7 +366,7 @@ row_undo_mod_clust(

if (err == DB_SUCCESS && node->rec_type == TRX_UNDO_UPD_DEL_REC) {

mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.start();
if (index->table->is_temporary()) {
mtr.set_log_mode(MTR_LOG_NO_REDO);
} else {
Expand All @@ -384,7 +384,7 @@ row_undo_mod_clust(
/* We may have to modify tree structure: do a
pessimistic descent down the index tree */

mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.start();
if (index->table->is_temporary()) {
mtr.set_log_mode(MTR_LOG_NO_REDO);
} else {
Expand Down Expand Up @@ -498,7 +498,7 @@ row_undo_mod_del_mark_or_remove_sec_low(
which cannot be purged yet, requires its existence. If some requires,
we should delete mark the record. */

mtr_start_trx(&mtr_vers, thr_get_trx(thr));
mtr_vers.start();

success = btr_pcur_restore_position(BTR_SEARCH_LEAF, &(node->pcur),
&mtr_vers);
Expand Down
16 changes: 8 additions & 8 deletions storage/innobase/row/row0upd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ row_upd_check_references_constraints(

DEBUG_SYNC_C("foreign_constraint_check_for_update");

mtr_start_trx(mtr, trx);
mtr->start();

if (trx->dict_operation_lock_mode == 0) {
got_s_lock = TRUE;
Expand Down Expand Up @@ -2298,7 +2298,7 @@ row_upd_sec_index_entry(
DEBUG_SYNC_C_IF_THD(trx->mysql_thd,
"before_row_upd_sec_index_entry");

mtr_start_trx(&mtr, trx);
mtr.start();

switch (index->space) {
case SRV_TMP_SPACE_ID:
Expand Down Expand Up @@ -2858,7 +2858,7 @@ row_upd_clust_rec(
/* We may have to modify the tree structure: do a pessimistic descent
down the index tree */

mtr_start_trx(mtr, thr_get_trx(thr));
mtr->start();
mtr->set_named_space(index->space);

/* Disable REDO logging as lifetime of temp-tables is limited to
Expand Down Expand Up @@ -3045,7 +3045,7 @@ row_upd_clust_step(

/* We have to restore the cursor to its position */

mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.start();
mtr.set_named_space(index->space);

/* Disable REDO logging as lifetime of temp-tables is limited to
Expand Down Expand Up @@ -3103,17 +3103,17 @@ row_upd_clust_step(
dict_drop_index_tree(
btr_pcur_get_rec(pcur), pcur, &mtr);

mtr_commit(&mtr);
mtr.commit();

mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.start();
mtr.set_named_space(index->space);

success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur,
&mtr);
if (!success) {
err = DB_ERROR;

mtr_commit(&mtr);
mtr.commit();

return(err);
}
Expand All @@ -3128,7 +3128,7 @@ row_upd_clust_step(
0, btr_pcur_get_block(pcur),
rec, index, offsets, thr);
if (err != DB_SUCCESS) {
mtr_commit(&mtr);
mtr.commit();
goto exit_func;
}
}
Expand Down

0 comments on commit d9c77f0

Please sign in to comment.