Revert "MDEV-6928: Add trx pointer to struct mtr_t"

This reverts commit 3486135bb5c9e21fd678821dee35484a81351cfb.

The commit comment ended in the words: "This is needed later."
Apparently the "later" never arrived.
This commit is contained in:
Marko Mäkelä 2018-01-29 11:01:02 +02:00
parent d01dbe66a8
commit 706ed8552d
42 changed files with 181 additions and 234 deletions

View File

@ -398,7 +398,7 @@ ib_read_tuple(
data = btr_rec_copy_externally_stored_field(
copy, offsets, zip_size, i, &len,
tuple->heap, NULL);
tuple->heap);
ut_a(len != UNIV_SQL_NULL);
}

View File

@ -3681,8 +3681,7 @@ btr_estimate_n_rows_in_range(
const dtuple_t* tuple1, /*!< in: range start, may also be empty tuple */
ulint mode1, /*!< in: search mode for range start */
const dtuple_t* tuple2, /*!< in: range end, may also be empty tuple */
ulint mode2, /*!< in: search mode for range end */
trx_t* trx) /*!< in: trx */
ulint mode2) /*!< in: search mode for range end */
{
btr_path_t path1[BTR_PATH_ARRAY_N_SLOTS];
btr_path_t path2[BTR_PATH_ARRAY_N_SLOTS];
@ -3700,7 +3699,7 @@ btr_estimate_n_rows_in_range(
table_n_rows = dict_table_get_n_rows(index->table);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
cursor.path_arr = path1;
@ -3718,7 +3717,7 @@ btr_estimate_n_rows_in_range(
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
cursor.path_arr = path2;
@ -5329,8 +5328,7 @@ btr_copy_blob_prefix(
ulint len, /*!< in: length of buf, in bytes */
ulint space_id,/*!< in: space id of the BLOB pages */
ulint page_no,/*!< in: page number of the first BLOB page */
ulint offset, /*!< in: offset on the first BLOB page */
trx_t* trx) /*!< in: transaction handle */
ulint offset) /*!< in: offset on the first BLOB page */
{
ulint copied_len = 0;
@ -5342,7 +5340,7 @@ btr_copy_blob_prefix(
ulint part_len;
ulint copy_len;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
block = buf_page_get(space_id, 0, page_no, RW_S_LATCH, &mtr);
buf_block_dbg_add_level(block, SYNC_EXTERN_STORAGE);
@ -5545,8 +5543,7 @@ btr_copy_externally_stored_field_prefix_low(
zero for uncompressed BLOBs */
ulint space_id,/*!< in: space id of the first BLOB page */
ulint page_no,/*!< in: page number of the first BLOB page */
ulint offset, /*!< in: offset on the first BLOB page */
trx_t* trx) /*!< in: transaction handle */
ulint offset) /*!< in: offset on the first BLOB page */
{
if (UNIV_UNLIKELY(len == 0)) {
return(0);
@ -5557,7 +5554,7 @@ btr_copy_externally_stored_field_prefix_low(
space_id, page_no, offset));
} else {
return(btr_copy_blob_prefix(buf, len, space_id,
page_no, offset, trx));
page_no, offset));
}
}
@ -5578,8 +5575,7 @@ btr_copy_externally_stored_field_prefix(
field containing also the reference to
the external part; must be protected by
a lock or a page latch */
ulint local_len,/*!< in: length of data, in bytes */
trx_t* trx) /*!< in: transaction handle */
ulint local_len)/*!< in: length of data, in bytes */
{
ulint space_id;
ulint page_no;
@ -5618,7 +5614,7 @@ btr_copy_externally_stored_field_prefix(
len - local_len,
zip_size,
space_id, page_no,
offset, trx));
offset));
}
/*******************************************************************//**
@ -5637,8 +5633,7 @@ btr_copy_externally_stored_field(
ulint zip_size,/*!< in: nonzero=compressed BLOB page size,
zero for uncompressed BLOBs */
ulint local_len,/*!< in: length of data */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx) /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: mem heap */
{
ulint space_id;
ulint page_no;
@ -5669,8 +5664,7 @@ btr_copy_externally_stored_field(
extern_len,
zip_size,
space_id,
page_no, offset,
trx);
page_no, offset);
return(buf);
}
@ -5689,8 +5683,7 @@ btr_rec_copy_externally_stored_field(
zero for uncompressed BLOBs */
ulint no, /*!< in: field number */
ulint* len, /*!< out: length of the field */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx) /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: mem heap */
{
ulint local_len;
const byte* data;
@ -5721,7 +5714,6 @@ btr_rec_copy_externally_stored_field(
}
return(btr_copy_externally_stored_field(len, data,
zip_size, local_len, heap,
trx));
zip_size, local_len, heap));
}
#endif /* !UNIV_HOTBACKUP */

View File

@ -486,7 +486,7 @@ btr_pcur_move_backward_from_page(
mtr_commit(mtr);
mtr_start_trx(mtr, mtr->trx);
mtr_start(mtr);
btr_pcur_restore_position(latch_mode2, cursor, mtr);

View File

@ -3361,8 +3361,7 @@ fts_fetch_doc_from_rec(
dict_table_zip_size(table),
clust_pos, &doc->text.f_len,
static_cast<mem_heap_t*>(
doc->self_heap->arg),
NULL);
doc->self_heap->arg));
} else {
doc->text.f_str = (byte*) rec_get_nth_field(
clust_rec, offsets, clust_pos,
@ -7599,8 +7598,7 @@ fts_init_recover_doc(
&doc.text.f_len,
static_cast<byte*>(dfield_get_data(dfield)),
zip_size, len,
static_cast<mem_heap_t*>(doc.self_heap->arg),
NULL);
static_cast<mem_heap_t*>(doc.self_heap->arg));
} else {
doc.text.f_str = static_cast<byte*>(
dfield_get_data(dfield));

View File

@ -1917,8 +1917,7 @@ fts_query_fetch_document(
if (dfield_is_ext(dfield)) {
data = btr_copy_externally_stored_field(
&cur_len, data, phrase->zip_size,
dfield_get_len(dfield), phrase->heap,
NULL);
dfield_get_len(dfield), phrase->heap);
} else {
cur_len = dfield_get_len(dfield);
}

View File

@ -11163,7 +11163,7 @@ ha_innobase::records_in_range(
n_rows = btr_estimate_n_rows_in_range(index, range_start,
mode1, range_end,
mode2, prebuilt->trx);
mode2);
} else {
n_rows = HA_POS_ERROR;

View File

@ -566,8 +566,7 @@ btr_estimate_n_rows_in_range(
const dtuple_t* tuple1, /*!< in: range start, may also be empty tuple */
ulint mode1, /*!< in: search mode for range start */
const dtuple_t* tuple2, /*!< in: range end, may also be empty tuple */
ulint mode2, /*!< in: search mode for range end */
trx_t* trx); /*!< in: trx */
ulint mode2); /*!< in: search mode for range end */
/*******************************************************************//**
Estimates the number of different key values in a given index, for
each n-column prefix of the index where 1 <= n <= dict_index_get_n_unique(index).
@ -703,8 +702,7 @@ btr_copy_externally_stored_field_prefix(
field containing also the reference to
the external part; must be protected by
a lock or a page latch */
ulint local_len,/*!< in: length of data, in bytes */
trx_t* trx); /*!< in: transaction handle */
ulint local_len);/*!< in: length of data, in bytes */
/*******************************************************************//**
Copies an externally stored field of a record to mem heap. The
clustered index record must be protected by a lock or a page latch.
@ -721,8 +719,7 @@ btr_copy_externally_stored_field(
ulint zip_size,/*!< in: nonzero=compressed BLOB page size,
zero for uncompressed BLOBs */
ulint local_len,/*!< in: length of data */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx); /*!< in: transaction handle */
mem_heap_t* heap); /*!< in: mem heap */
/*******************************************************************//**
Copies an externally stored field of a record to mem heap.
@return the field copied to heap, or NULL if the field is incomplete */
@ -737,8 +734,7 @@ btr_rec_copy_externally_stored_field(
zero for uncompressed BLOBs */
ulint no, /*!< in: field number */
ulint* len, /*!< out: length of the field */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx); /*!< in: transaction handle */
mem_heap_t* heap); /*!< in: mem heap */
/*******************************************************************//**
Flags the data tuple fields that are marked as extern storage in the
update vector. We use this function to remember which fields we must

View File

@ -36,7 +36,6 @@ Created 11/26/1995 Heikki Tuuri
#include "ut0byte.h"
#include "mtr0types.h"
#include "page0types.h"
#include "trx0types.h"
/* Logging modes for a mini-transaction */
#define MTR_LOG_ALL 21 /* default mode: log all operations
@ -202,15 +201,6 @@ functions). The page number parameter was originally written as 0. @{ */
/* included here because it needs MLOG_LSN defined */
#include "log0log.h"
/***************************************************************//**
Starts a mini-transaction. */
UNIV_INLINE
void
mtr_start_trx(
/*======*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx) /*!< in: transaction */
MY_ATTRIBUTE((nonnull (1)));
/***************************************************************//**
Starts a mini-transaction. */
UNIV_INLINE
@ -218,10 +208,7 @@ void
mtr_start(
/*======*/
mtr_t* mtr) /*!< out: mini-transaction */
{
mtr_start_trx(mtr, NULL);
}
MY_ATTRIBUTE((nonnull))
MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits a mini-transaction. */
UNIV_INTERN
@ -417,7 +404,6 @@ struct mtr_t{
#ifdef UNIV_DEBUG
ulint magic_n;
#endif /* UNIV_DEBUG */
trx_t* trx; /*!< transaction */
};
#ifdef UNIV_DEBUG

View File

@ -43,10 +43,9 @@ mtr_block_dirtied(
Starts a mini-transaction. */
UNIV_INLINE
void
mtr_start_trx(
mtr_start(
/*======*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx) /*!< in: transaction */
mtr_t* mtr) /*!< out: mini-transaction */
{
UNIV_MEM_INVALID(mtr, sizeof *mtr);
@ -59,7 +58,6 @@ mtr_start_trx(
mtr->made_dirty = FALSE;
mtr->n_log_recs = 0;
mtr->n_freed_pages = 0;
mtr->trx = trx;
ut_d(mtr->state = MTR_ACTIVE);
ut_d(mtr->magic_n = MTR_MAGIC_N);

View File

@ -246,13 +246,22 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
trx_undo_truncate_end_func(
/*=======================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in/out: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(trx,undo,limit)
#else /* UNIV_DEBUG */
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(undo,limit)
#endif /* UNIV_DEBUG */
/***********************************************************************//**
Truncates an undo log from the start. This function is used during a purge

View File

@ -78,8 +78,7 @@ row_ext_cache_fill(
crashed during the execution of
btr_free_externally_stored_field(). */
ext->len[i] = btr_copy_externally_stored_field_prefix(
buf, ext->max_len, zip_size, field, f_len,
NULL);
buf, ext->max_len, zip_size, field, f_len);
}
}
}

View File

@ -675,8 +675,7 @@ loop:
doc.text.f_str =
btr_copy_externally_stored_field(
&doc.text.f_len, data,
zip_size, data_len, blob_heap,
NULL);
zip_size, data_len, blob_heap);
} else {
doc.text.f_str = data;
doc.text.f_len = data_len;

View File

@ -1305,7 +1305,7 @@ row_ins_foreign_check_on_constraint(
row_mysql_freeze_data_dictionary(thr_get_trx(thr));
mtr_start_trx(mtr, trx);
mtr_start(mtr);
/* Restore pcur position */
@ -1333,7 +1333,7 @@ nonstandard_exit_func:
btr_pcur_store_position(pcur, mtr);
mtr_commit(mtr);
mtr_start_trx(mtr, trx);
mtr_start(mtr);
btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr);
@ -1543,7 +1543,7 @@ run_again:
}
}
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Store old value on n_fields_cmp */
@ -2330,7 +2330,7 @@ row_ins_clust_index_entry_low(
|| n_uniq == dict_index_get_n_unique(index));
ut_ad(!n_uniq || n_uniq == dict_index_get_n_unique(index));
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) {
mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED;
@ -2543,10 +2543,9 @@ Starts a mini-transaction and checks if the index will be dropped.
@return true if the index is to be dropped */
static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_ins_sec_mtr_start_trx_and_check_if_aborted(
row_ins_sec_mtr_start_and_check_if_aborted(
/*=======================================*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx, /*!< in: transaction handle */
dict_index_t* index, /*!< in/out: secondary index */
bool check, /*!< in: whether to check */
ulint search_mode)
@ -2554,7 +2553,7 @@ row_ins_sec_mtr_start_trx_and_check_if_aborted(
{
ut_ad(!dict_index_is_clust(index));
mtr_start_trx(mtr, trx);
mtr_start(mtr);
if (!check) {
return(false);
@ -2612,14 +2611,13 @@ row_ins_sec_index_entry_low(
ulint n_unique;
mtr_t mtr;
ulint* offsets = NULL;
trx_t* trx = thr_get_trx(thr);
ut_ad(!dict_index_is_clust(index));
ut_ad(mode == BTR_MODIFY_LEAF || mode == BTR_MODIFY_TREE);
cursor.thr = thr;
ut_ad(thr_get_trx(thr)->id);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Ensure that we acquire index->lock when inserting into an
index with index->online_status == ONLINE_INDEX_COMPLETE, but
@ -2680,8 +2678,8 @@ row_ins_sec_index_entry_low(
DEBUG_SYNC_C("row_ins_sec_index_unique");
if (row_ins_sec_mtr_start_trx_and_check_if_aborted(
&mtr, trx, index, check, search_mode)) {
if (row_ins_sec_mtr_start_and_check_if_aborted(
&mtr, index, check, search_mode)) {
goto func_exit;
}
@ -2715,8 +2713,8 @@ row_ins_sec_index_entry_low(
return(err);
}
if (row_ins_sec_mtr_start_trx_and_check_if_aborted(
&mtr, trx, index, check, search_mode)) {
if (row_ins_sec_mtr_start_and_check_if_aborted(
&mtr, index, check, search_mode)) {
goto func_exit;
}

View File

@ -1011,7 +1011,7 @@ row_log_table_get_pk_col(
mem_heap_alloc(heap, field_len));
len = btr_copy_externally_stored_field_prefix(
blob_field, field_len, zip_size, field, len, NULL);
blob_field, field_len, zip_size, field, len);
if (len >= max_len + 1) {
return(DB_TOO_BIG_INDEX_COL);
}
@ -1404,7 +1404,7 @@ row_log_table_apply_convert_mrec(
data = btr_rec_copy_externally_stored_field(
mrec, offsets,
dict_table_zip_size(index->table),
i, &len, heap, NULL);
i, &len, heap);
ut_a(data);
dfield_set_data(dfield, data, len);
blob_done:

View File

@ -273,7 +273,7 @@ row_merge_buf_redundant_convert(
field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE));
byte* data = btr_copy_externally_stored_field(
&ext_len, field_data, zip_size, field_len, heap, NULL);
&ext_len, field_data, zip_size, field_len, heap);
ut_ad(ext_len < len);
@ -2445,7 +2445,7 @@ row_merge_copy_blobs(
BLOB pointers are read (row_merge_read_clustered_index())
and dereferenced (below). */
data = btr_rec_copy_externally_stored_field(
mrec, offsets, zip_size, i, &len, heap, NULL);
mrec, offsets, zip_size, i, &len, heap);
/* Because we have locked the table, any records
written by incomplete transactions must have been
rolled back already. There must not be any incomplete

View File

@ -1942,7 +1942,7 @@ row_unlock_for_mysql(
trx_id_t rec_trx_id;
mtr_t mtr;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Restore the cursor position and find the record */
@ -3476,7 +3476,7 @@ row_truncate_table_for_mysql(
index = dict_table_get_next_index(index);
} while (index);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
fsp_header_init(space,
FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
@ -3505,7 +3505,7 @@ row_truncate_table_for_mysql(
sys_index = dict_table_get_first_index(dict_sys->sys_indexes);
dict_index_copy_types(tuple, sys_index, 1);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
BTR_MODIFY_LEAF, &pcur, &mtr);
for (;;) {
@ -3552,7 +3552,7 @@ row_truncate_table_for_mysql(
a page in this mini-transaction, and the rest of
this loop could latch another index page. */
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
btr_pcur_restore_position(BTR_MODIFY_LEAF,
&pcur, &mtr);
}

View File

@ -135,8 +135,7 @@ row_sel_sec_rec_is_for_blob(
len = btr_copy_externally_stored_field_prefix(buf, prefix_len,
zip_size,
clust_field, clust_len,
NULL);
clust_field, clust_len);
if (UNIV_UNLIKELY(len == 0)) {
/* The BLOB was being deleted as the server crashed.
@ -455,7 +454,7 @@ row_sel_fetch_columns(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(index->table),
field_no, &len, heap, NULL);
field_no, &len, heap);
/* data == NULL means that the
externally stored field was not
@ -1402,7 +1401,7 @@ table_loop:
/* Open a cursor to index, or restore an open cursor position */
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (consistent_read && plan->unique_search && !plan->pcur_is_open
&& !plan->must_get_clust
@ -1442,7 +1441,7 @@ table_loop:
plan_reset_cursor(plan);
mtr_commit(&mtr);
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
}
if (search_latch_locked) {
@ -2813,7 +2812,7 @@ row_sel_store_mysql_field_func(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(prebuilt->table),
field_no, &len, heap, NULL);
field_no, &len, heap);
if (UNIV_UNLIKELY(!data)) {
/* The externally stored field was not written
@ -3921,7 +3920,7 @@ row_search_for_mysql(
}
}
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/*-------------------------------------------------------------*/
/* PHASE 2: Try fast adaptive hash index search if possible */
@ -4052,7 +4051,7 @@ release_search_latch_if_needed:
}
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
}
}
@ -5041,7 +5040,7 @@ next_rec:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
if (sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF,
pcur, moves_up, &mtr)) {
@ -5106,7 +5105,7 @@ lock_table_wait:
/* It was a lock wait, and it ended */
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Table lock waited, go try to obtain table lock
again */

View File

@ -299,7 +299,7 @@ row_undo_mod_clust(
pcur = &node->pcur;
index = btr_cur_get_index(btr_pcur_get_btr_cur(pcur));
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
online = dict_index_is_online_ddl(index);
if (online) {
@ -328,7 +328,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(&mtr);
err = row_undo_mod_clust_low(
node, &offsets, &offsets_heap,
@ -373,7 +373,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(&mtr);
/* It is not necessary to call row_log_table,
because the record is delete-marked and would thus
@ -386,7 +386,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(&mtr);
err = row_undo_mod_remove_clust_low(node, thr, &mtr,
BTR_MODIFY_TREE);
@ -433,7 +433,7 @@ row_undo_mod_del_mark_or_remove_sec_low(
enum row_search_result search_result;
log_free_check();
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_TREE
&& index->space == IBUF_SPACE_ID
&& !dict_index_is_unique(index)) {
@ -494,7 +494,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_start(&mtr_vers);
success = btr_pcur_restore_position(BTR_SEARCH_LEAF, &(node->pcur),
&mtr_vers);
@ -610,7 +610,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
ut_ad(trx->id);
log_free_check();
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_TREE
&& index->space == IBUF_SPACE_ID
&& !dict_index_is_unique(index)) {

View File

@ -211,7 +211,7 @@ row_upd_check_references_constraints(
DEBUG_SYNC_C("foreign_constraint_check_for_update");
mtr_start_trx(mtr, trx);
mtr_start(mtr);
if (trx->dict_operation_lock_mode == 0) {
got_s_lock = TRUE;
@ -985,7 +985,7 @@ row_upd_ext_fetch(
byte* buf = static_cast<byte*>(mem_heap_alloc(heap, *len));
*len = btr_copy_externally_stored_field_prefix(
buf, *len, zip_size, data, local_len, NULL);
buf, *len, zip_size, data, local_len);
/* We should never update records containing a half-deleted BLOB. */
ut_a(*len);
@ -1682,7 +1682,7 @@ row_upd_sec_index_entry(
}
#endif /* UNIV_DEBUG */
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
if (*index->name == TEMP_INDEX_PREFIX) {
/* The index->online_status may change if the
@ -2149,7 +2149,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);
/* NOTE: this transaction has an s-lock or x-lock on the record and
therefore other transactions cannot modify the record when we have no
@ -2316,7 +2316,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);
/* If the restoration does not succeed, then the same
transaction has deleted the record on which the cursor was,
@ -2370,7 +2370,7 @@ row_upd_clust_step(
mtr_commit(&mtr);
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur,
&mtr);

View File

@ -467,7 +467,7 @@ trx_undo_page_fetch_ext(
{
/* Fetch the BLOB. */
ulint ext_len = btr_copy_externally_stored_field_prefix(
ext_buf, prefix_len, zip_size, field, *len, NULL);
ext_buf, prefix_len, zip_size, field, *len);
/* BLOBs should always be nonempty. */
ut_a(ext_len);
/* Append the BLOB pointer to the prefix. */
@ -1266,7 +1266,7 @@ trx_undo_report_row_operation(
rseg = trx->rseg;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&trx->undo_mutex);
/* If the undo log is not assigned yet, assign one */
@ -1342,7 +1342,7 @@ trx_undo_report_row_operation(
latches, such as SYNC_FSP and SYNC_FSP_PAGE. */
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&rseg->mutex);
trx_undo_free_last_page(trx, undo, &mtr);
@ -1379,7 +1379,7 @@ trx_undo_report_row_operation(
/* We have to extend the undo log by one page */
ut_ad(++loop_count < 2);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* When we add a page to an undo log, this is analogous to
a pessimistic insert in a B-tree, and we must reserve the

View File

@ -1070,9 +1070,11 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
trx_undo_truncate_end_func(
/*=======================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
@ -1087,7 +1089,7 @@ trx_undo_truncate_end(
ut_ad(mutex_own(&(trx->rseg->mutex)));
for (;;) {
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
trunc_here = NULL;
@ -1774,7 +1776,7 @@ trx_undo_assign_undo(
ut_ad(mutex_own(&(trx->undo_mutex)));
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&rseg->mutex);

View File

@ -398,7 +398,7 @@ ib_read_tuple(
data = btr_rec_copy_externally_stored_field(
copy, offsets, zip_size, i, &len,
tuple->heap, NULL);
tuple->heap);
ut_a(len != UNIV_SQL_NULL);
}

View File

@ -3886,7 +3886,6 @@ static const ib_int64_t rows_in_range_arbitrary_ret_val = 10;
@param[in] mode1 search mode for range start
@param[in] tuple2 range end, may also be empty tuple
@param[in] mode2 search mode for range end
@param[in] trx trx
@param[in] nth_attempt if the tree gets modified too much while
we are trying to analyze it, then we will retry (this function will call
itself, incrementing this parameter)
@ -3903,7 +3902,6 @@ btr_estimate_n_rows_in_range_low(
ulint mode1,
const dtuple_t* tuple2,
ulint mode2,
trx_t* trx,
unsigned nth_attempt)
{
btr_path_t path1[BTR_PATH_ARRAY_N_SLOTS];
@ -3922,7 +3920,7 @@ btr_estimate_n_rows_in_range_low(
table_n_rows = dict_table_get_n_rows(index->table);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
cursor.path_arr = path1;
@ -3940,7 +3938,7 @@ btr_estimate_n_rows_in_range_low(
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
#ifdef UNIV_DEBUG
if (!strcmp(index->name, "iC")) {
@ -4035,7 +4033,7 @@ btr_estimate_n_rows_in_range_low(
const ib_int64_t ret =
btr_estimate_n_rows_in_range_low(
index, tuple1, mode1,
tuple2, mode2, trx,
tuple2, mode2,
nth_attempt + 1);
return(ret);
@ -4096,7 +4094,6 @@ btr_estimate_n_rows_in_range_low(
@param[in] mode1 search mode for range start
@param[in] tuple2 range end, may also be empty tuple
@param[in] mode2 search mode for range end
@param[in] trx trx
@return estimated number of rows */
ib_int64_t
btr_estimate_n_rows_in_range(
@ -4104,11 +4101,10 @@ btr_estimate_n_rows_in_range(
const dtuple_t* tuple1,
ulint mode1,
const dtuple_t* tuple2,
ulint mode2,
trx_t* trx)
ulint mode2)
{
const ib_int64_t ret = btr_estimate_n_rows_in_range_low(
index, tuple1, mode1, tuple2, mode2, trx,
index, tuple1, mode1, tuple2, mode2,
1 /* first attempt */);
return(ret);
@ -5627,8 +5623,7 @@ btr_copy_blob_prefix(
ulint len, /*!< in: length of buf, in bytes */
ulint space_id,/*!< in: space id of the BLOB pages */
ulint page_no,/*!< in: page number of the first BLOB page */
ulint offset, /*!< in: offset on the first BLOB page */
trx_t* trx) /*!< in: transaction handle */
ulint offset) /*!< in: offset on the first BLOB page */
{
ulint copied_len = 0;
@ -5640,7 +5635,7 @@ btr_copy_blob_prefix(
ulint part_len;
ulint copy_len;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
block = buf_page_get(space_id, 0, page_no, RW_S_LATCH, &mtr);
buf_block_dbg_add_level(block, SYNC_EXTERN_STORAGE);
@ -5843,8 +5838,7 @@ btr_copy_externally_stored_field_prefix_low(
zero for uncompressed BLOBs */
ulint space_id,/*!< in: space id of the first BLOB page */
ulint page_no,/*!< in: page number of the first BLOB page */
ulint offset, /*!< in: offset on the first BLOB page */
trx_t* trx) /*!< in: transaction handle */
ulint offset) /*!< in: offset on the first BLOB page */
{
if (UNIV_UNLIKELY(len == 0)) {
return(0);
@ -5855,7 +5849,7 @@ btr_copy_externally_stored_field_prefix_low(
space_id, page_no, offset));
} else {
return(btr_copy_blob_prefix(buf, len, space_id,
page_no, offset, trx));
page_no, offset));
}
}
@ -5876,8 +5870,7 @@ btr_copy_externally_stored_field_prefix(
field containing also the reference to
the external part; must be protected by
a lock or a page latch */
ulint local_len,/*!< in: length of data, in bytes */
trx_t* trx) /*!< in: transaction handle */
ulint local_len)/*!< in: length of data, in bytes */
{
ulint space_id;
ulint page_no;
@ -5916,7 +5909,7 @@ btr_copy_externally_stored_field_prefix(
len - local_len,
zip_size,
space_id, page_no,
offset, trx));
offset));
}
/*******************************************************************//**
@ -5935,8 +5928,7 @@ btr_copy_externally_stored_field(
ulint zip_size,/*!< in: nonzero=compressed BLOB page size,
zero for uncompressed BLOBs */
ulint local_len,/*!< in: length of data */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx) /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: mem heap */
{
ulint space_id;
ulint page_no;
@ -5967,8 +5959,7 @@ btr_copy_externally_stored_field(
extern_len,
zip_size,
space_id,
page_no, offset,
trx);
page_no, offset);
return(buf);
}
@ -5987,8 +5978,7 @@ btr_rec_copy_externally_stored_field(
zero for uncompressed BLOBs */
ulint no, /*!< in: field number */
ulint* len, /*!< out: length of the field */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx) /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: mem heap */
{
ulint local_len;
const byte* data;
@ -6019,7 +6009,6 @@ btr_rec_copy_externally_stored_field(
}
return(btr_copy_externally_stored_field(len, data,
zip_size, local_len, heap,
trx));
zip_size, local_len, heap));
}
#endif /* !UNIV_HOTBACKUP */

View File

@ -502,7 +502,7 @@ btr_pcur_move_backward_from_page(
mtr_commit(mtr);
mtr_start_trx(mtr, mtr->trx);
mtr_start(mtr);
btr_pcur_restore_position(latch_mode2, cursor, mtr);

View File

@ -3361,8 +3361,7 @@ fts_fetch_doc_from_rec(
dict_table_zip_size(table),
clust_pos, &doc->text.f_len,
static_cast<mem_heap_t*>(
doc->self_heap->arg),
NULL);
doc->self_heap->arg));
} else {
doc->text.f_str = (byte*) rec_get_nth_field(
clust_rec, offsets, clust_pos,
@ -7591,8 +7590,7 @@ fts_init_recover_doc(
&doc.text.f_len,
static_cast<byte*>(dfield_get_data(dfield)),
zip_size, len,
static_cast<mem_heap_t*>(doc.self_heap->arg),
NULL);
static_cast<mem_heap_t*>(doc.self_heap->arg));
} else {
doc.text.f_str = static_cast<byte*>(
dfield_get_data(dfield));

View File

@ -1937,8 +1937,7 @@ fts_query_fetch_document(
if (dfield_is_ext(dfield)) {
data = btr_copy_externally_stored_field(
&cur_len, data, phrase->zip_size,
dfield_get_len(dfield), phrase->heap,
NULL);
dfield_get_len(dfield), phrase->heap);
} else {
cur_len = dfield_get_len(dfield);
}

View File

@ -11978,7 +11978,7 @@ ha_innobase::records_in_range(
n_rows = btr_estimate_n_rows_in_range(index, range_start,
mode1, range_end,
mode2, prebuilt->trx);
mode2);
} else {
n_rows = HA_POS_ERROR;

View File

@ -568,8 +568,7 @@ btr_estimate_n_rows_in_range(
const dtuple_t* tuple1, /*!< in: range start, may also be empty tuple */
ulint mode1, /*!< in: search mode for range start */
const dtuple_t* tuple2, /*!< in: range end, may also be empty tuple */
ulint mode2, /*!< in: search mode for range end */
trx_t* trx); /*!< in: trx */
ulint mode2); /*!< in: search mode for range end */
/*******************************************************************//**
Estimates the number of different key values in a given index, for
each n-column prefix of the index where 1 <= n <= dict_index_get_n_unique(index).
@ -704,8 +703,7 @@ btr_copy_externally_stored_field_prefix(
field containing also the reference to
the external part; must be protected by
a lock or a page latch */
ulint local_len,/*!< in: length of data, in bytes */
trx_t* trx); /*!< in: transaction handle */
ulint local_len);/*!< in: length of data, in bytes */
/*******************************************************************//**
Copies an externally stored field of a record to mem heap. The
clustered index record must be protected by a lock or a page latch.
@ -722,8 +720,7 @@ btr_copy_externally_stored_field(
ulint zip_size,/*!< in: nonzero=compressed BLOB page size,
zero for uncompressed BLOBs */
ulint local_len,/*!< in: length of data */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx); /*!< in: transaction handle */
mem_heap_t* heap); /*!< in: mem heap */
/*******************************************************************//**
Copies an externally stored field of a record to mem heap.
@return the field copied to heap, or NULL if the field is incomplete */
@ -738,8 +735,7 @@ btr_rec_copy_externally_stored_field(
zero for uncompressed BLOBs */
ulint no, /*!< in: field number */
ulint* len, /*!< out: length of the field */
mem_heap_t* heap, /*!< in: mem heap */
trx_t* trx); /*!< in: transaction handle */
mem_heap_t* heap); /*!< in: mem heap */
/*******************************************************************//**
Flags the data tuple fields that are marked as extern storage in the
update vector. We use this function to remember which fields we must

View File

@ -35,7 +35,6 @@ Created 11/26/1995 Heikki Tuuri
#include "ut0byte.h"
#include "mtr0types.h"
#include "page0types.h"
#include "trx0types.h"
/* Logging modes for a mini-transaction */
#define MTR_LOG_ALL 21 /* default mode: log all operations
@ -201,15 +200,6 @@ functions). The page number parameter was originally written as 0. @{ */
/* included here because it needs MLOG_LSN defined */
#include "log0log.h"
/***************************************************************//**
Starts a mini-transaction. */
UNIV_INLINE
void
mtr_start_trx(
/*======*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx) /*!< in: transaction */
__attribute__((nonnull (1)));
/***************************************************************//**
Starts a mini-transaction. */
UNIV_INLINE
@ -217,10 +207,7 @@ void
mtr_start(
/*======*/
mtr_t* mtr) /*!< out: mini-transaction */
{
mtr_start_trx(mtr, NULL);
}
MY_ATTRIBUTE((nonnull))
MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits a mini-transaction. */
UNIV_INTERN
@ -415,7 +402,6 @@ struct mtr_t{
#ifdef UNIV_DEBUG
ulint magic_n;
#endif /* UNIV_DEBUG */
trx_t* trx; /*!< transaction */
};
#ifdef UNIV_DEBUG

View File

@ -43,10 +43,9 @@ mtr_block_dirtied(
Starts a mini-transaction. */
UNIV_INLINE
void
mtr_start_trx(
mtr_start(
/*======*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx) /*!< in: transaction */
mtr_t* mtr) /*!< out: mini-transaction */
{
UNIV_MEM_INVALID(mtr, sizeof *mtr);
@ -59,7 +58,6 @@ mtr_start_trx(
mtr->made_dirty = FALSE;
mtr->n_log_recs = 0;
mtr->n_freed_pages = 0;
mtr->trx = trx;
ut_d(mtr->state = MTR_ACTIVE);
ut_d(mtr->magic_n = MTR_MAGIC_N);

View File

@ -243,13 +243,22 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
trx_undo_truncate_end_func(
/*=======================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in/out: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(trx,undo,limit)
#else /* UNIV_DEBUG */
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(undo,limit)
#endif /* UNIV_DEBUG */
/***********************************************************************//**
Truncates an undo log from the start. This function is used during a purge

View File

@ -78,8 +78,7 @@ row_ext_cache_fill(
crashed during the execution of
btr_free_externally_stored_field(). */
ext->len[i] = btr_copy_externally_stored_field_prefix(
buf, ext->max_len, zip_size, field, f_len,
NULL);
buf, ext->max_len, zip_size, field, f_len);
}
}
}

View File

@ -678,8 +678,7 @@ loop:
doc.text.f_str =
btr_copy_externally_stored_field(
&doc.text.f_len, data,
zip_size, data_len, blob_heap,
NULL);
zip_size, data_len, blob_heap);
} else {
doc.text.f_str = data;
doc.text.f_len = data_len;

View File

@ -1311,7 +1311,7 @@ row_ins_foreign_check_on_constraint(
row_mysql_freeze_data_dictionary(thr_get_trx(thr));
mtr_start_trx(mtr, trx);
mtr_start(mtr);
/* Restore pcur position */
@ -1339,7 +1339,7 @@ nonstandard_exit_func:
btr_pcur_store_position(pcur, mtr);
mtr_commit(mtr);
mtr_start_trx(mtr, trx);
mtr_start(mtr);
btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr);
@ -1549,7 +1549,7 @@ run_again:
}
}
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Store old value on n_fields_cmp */
@ -2360,7 +2360,7 @@ row_ins_clust_index_entry_low(
search_mode = mode;
}
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) {
@ -2592,10 +2592,9 @@ Starts a mini-transaction and checks if the index will be dropped.
@return true if the index is to be dropped */
static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_ins_sec_mtr_start_trx_and_check_if_aborted(
row_ins_sec_mtr_start_and_check_if_aborted(
/*=======================================*/
mtr_t* mtr, /*!< out: mini-transaction */
trx_t* trx, /*!< in: transaction handle */
dict_index_t* index, /*!< in/out: secondary index */
bool check, /*!< in: whether to check */
ulint search_mode)
@ -2603,7 +2602,7 @@ row_ins_sec_mtr_start_trx_and_check_if_aborted(
{
ut_ad(!dict_index_is_clust(index));
mtr_start_trx(mtr, trx);
mtr_start(mtr);
if (!check) {
return(false);
@ -2661,14 +2660,13 @@ row_ins_sec_index_entry_low(
ulint n_unique;
mtr_t mtr;
ulint* offsets = NULL;
trx_t* trx = thr_get_trx(thr);
ut_ad(!dict_index_is_clust(index));
ut_ad(mode == BTR_MODIFY_LEAF || mode == BTR_MODIFY_TREE);
cursor.thr = thr;
ut_ad(thr_get_trx(thr)->id);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* If running with fake_changes mode on then avoid using insert buffer
and also switch from modify to search so that code takes only s-latch
@ -2753,8 +2751,8 @@ row_ins_sec_index_entry_low(
DEBUG_SYNC_C("row_ins_sec_index_unique");
if (row_ins_sec_mtr_start_trx_and_check_if_aborted(
&mtr, trx, index, check, search_mode)) {
if (row_ins_sec_mtr_start_and_check_if_aborted(
&mtr, index, check, search_mode)) {
goto func_exit;
}
@ -2788,8 +2786,8 @@ row_ins_sec_index_entry_low(
return(err);
}
if (row_ins_sec_mtr_start_trx_and_check_if_aborted(
&mtr, trx, index, check, search_mode)) {
if (row_ins_sec_mtr_start_and_check_if_aborted(
&mtr, index, check, search_mode)) {
goto func_exit;
}

View File

@ -1011,7 +1011,7 @@ row_log_table_get_pk_col(
mem_heap_alloc(heap, field_len));
len = btr_copy_externally_stored_field_prefix(
blob_field, field_len, zip_size, field, len, NULL);
blob_field, field_len, zip_size, field, len);
if (len >= max_len + 1) {
return(DB_TOO_BIG_INDEX_COL);
}
@ -1404,7 +1404,7 @@ row_log_table_apply_convert_mrec(
data = btr_rec_copy_externally_stored_field(
mrec, offsets,
dict_table_zip_size(index->table),
i, &len, heap, NULL);
i, &len, heap);
ut_a(data);
dfield_set_data(dfield, data, len);
blob_done:

View File

@ -274,7 +274,7 @@ row_merge_buf_redundant_convert(
field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE));
byte* data = btr_copy_externally_stored_field(
&ext_len, field_data, zip_size, field_len, heap, trx);
&ext_len, field_data, zip_size, field_len, heap);
ut_ad(ext_len < len);
@ -2449,7 +2449,7 @@ row_merge_copy_blobs(
BLOB pointers are read (row_merge_read_clustered_index())
and dereferenced (below). */
data = btr_rec_copy_externally_stored_field(
mrec, offsets, zip_size, i, &len, heap, NULL);
mrec, offsets, zip_size, i, &len, heap);
/* Because we have locked the table, any records
written by incomplete transactions must have been
rolled back already. There must not be any incomplete

View File

@ -1950,7 +1950,7 @@ row_unlock_for_mysql(
trx_id_t rec_trx_id;
mtr_t mtr;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Restore the cursor position and find the record */
@ -3495,7 +3495,7 @@ row_truncate_table_for_mysql(
index = dict_table_get_next_index(index);
} while (index);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
fsp_header_init(space,
FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
@ -3524,7 +3524,7 @@ row_truncate_table_for_mysql(
sys_index = dict_table_get_first_index(dict_sys->sys_indexes);
dict_index_copy_types(tuple, sys_index, 1);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
BTR_MODIFY_LEAF, &pcur, &mtr);
for (;;) {
@ -3571,7 +3571,7 @@ row_truncate_table_for_mysql(
a page in this mini-transaction, and the rest of
this loop could latch another index page. */
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
btr_pcur_restore_position(BTR_MODIFY_LEAF,
&pcur, &mtr);
}

View File

@ -138,8 +138,7 @@ row_sel_sec_rec_is_for_blob(
len = btr_copy_externally_stored_field_prefix(buf, prefix_len,
zip_size,
clust_field, clust_len,
NULL);
clust_field, clust_len);
if (UNIV_UNLIKELY(len == 0)) {
/* The BLOB was being deleted as the server crashed.
@ -458,7 +457,7 @@ row_sel_fetch_columns(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(index->table),
field_no, &len, heap, NULL);
field_no, &len, heap);
/* data == NULL means that the
externally stored field was not
@ -1406,7 +1405,7 @@ table_loop:
/* Open a cursor to index, or restore an open cursor position */
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (consistent_read && plan->unique_search && !plan->pcur_is_open
&& !plan->must_get_clust
@ -1447,7 +1446,7 @@ table_loop:
plan_reset_cursor(plan);
mtr_commit(&mtr);
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
}
if (search_latch_locked) {
@ -2828,7 +2827,7 @@ row_sel_store_mysql_field_func(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(prebuilt->table),
field_no, &len, heap, NULL);
field_no, &len, heap);
if (UNIV_UNLIKELY(!data)) {
/* The externally stored field was not written
@ -3926,7 +3925,7 @@ row_search_for_mysql(
}
}
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/*-------------------------------------------------------------*/
/* PHASE 2: Try fast adaptive hash index search if possible */
@ -5141,7 +5140,7 @@ next_rec:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
if (sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF,
pcur, moves_up, &mtr)) {
@ -5206,7 +5205,7 @@ lock_table_wait:
/* It was a lock wait, and it ended */
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* Table lock waited, go try to obtain table lock
again */

View File

@ -269,7 +269,7 @@ row_undo_mod_clust(
pcur = &node->pcur;
index = btr_cur_get_index(btr_pcur_get_btr_cur(pcur));
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
online = dict_index_is_online_ddl(index);
if (online) {
@ -298,7 +298,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(&mtr);
err = row_undo_mod_clust_low(
node, &offsets, &offsets_heap,
@ -343,7 +343,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(&mtr);
/* It is not necessary to call row_log_table,
because the record is delete-marked and would thus
@ -356,7 +356,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(&mtr);
err = row_undo_mod_remove_clust_low(node, thr, &mtr,
BTR_MODIFY_TREE);
@ -403,7 +403,7 @@ row_undo_mod_del_mark_or_remove_sec_low(
enum row_search_result search_result;
log_free_check();
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_TREE
&& index->space == IBUF_SPACE_ID
&& !dict_index_is_unique(index)) {
@ -464,7 +464,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_start(&mtr_vers);
success = btr_pcur_restore_position(BTR_SEARCH_LEAF, &(node->pcur),
&mtr_vers);
@ -580,7 +580,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
ut_ad(trx->id);
log_free_check();
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
if (mode == BTR_MODIFY_TREE
&& index->space == IBUF_SPACE_ID
&& !dict_index_is_unique(index)) {

View File

@ -213,7 +213,7 @@ row_upd_check_references_constraints(
DEBUG_SYNC_C("foreign_constraint_check_for_update");
mtr_start_trx(mtr, trx);
mtr_start(mtr);
if (trx->dict_operation_lock_mode == 0) {
got_s_lock = TRUE;
@ -987,7 +987,7 @@ row_upd_ext_fetch(
byte* buf = static_cast<byte*>(mem_heap_alloc(heap, *len));
*len = btr_copy_externally_stored_field_prefix(
buf, *len, zip_size, data, local_len, NULL);
buf, *len, zip_size, data, local_len);
/* We should never update records containing a half-deleted BLOB. */
ut_a(*len);
@ -1684,7 +1684,7 @@ row_upd_sec_index_entry(
}
#endif /* UNIV_DEBUG */
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
if (*index->name == TEMP_INDEX_PREFIX) {
/* The index->online_status may change if the
@ -2157,7 +2157,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);
/* NOTE: this transaction has an s-lock or x-lock on the record and
therefore other transactions cannot modify the record when we have no
@ -2327,7 +2327,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);
/* If the restoration does not succeed, then the same
transaction has deleted the record on which the cursor was,
@ -2400,7 +2400,7 @@ row_upd_clust_step(
mtr_commit(&mtr);
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr_start(&mtr);
success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur,
&mtr);

View File

@ -467,7 +467,7 @@ trx_undo_page_fetch_ext(
{
/* Fetch the BLOB. */
ulint ext_len = btr_copy_externally_stored_field_prefix(
ext_buf, prefix_len, zip_size, field, *len, NULL);
ext_buf, prefix_len, zip_size, field, *len);
/* BLOBs should always be nonempty. */
ut_a(ext_len);
/* Append the BLOB pointer to the prefix. */
@ -1268,7 +1268,7 @@ trx_undo_report_row_operation(
rseg = trx->rseg;
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&trx->undo_mutex);
/* If the undo log is not assigned yet, assign one */
@ -1345,7 +1345,7 @@ trx_undo_report_row_operation(
latches, such as SYNC_FSP and SYNC_FSP_PAGE. */
mtr_commit(&mtr);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&rseg->mutex);
trx_undo_free_last_page(trx, undo, &mtr);
@ -1382,7 +1382,7 @@ trx_undo_report_row_operation(
/* We have to extend the undo log by one page */
ut_ad(++loop_count < 2);
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
/* When we add a page to an undo log, this is analogous to
a pessimistic insert in a B-tree, and we must reserve the

View File

@ -1070,9 +1070,11 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
trx_undo_truncate_end_func(
/*=======================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
@ -1087,7 +1089,7 @@ trx_undo_truncate_end(
ut_ad(mutex_own(&(trx->rseg->mutex)));
for (;;) {
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
trunc_here = NULL;
@ -1774,7 +1776,7 @@ trx_undo_assign_undo(
ut_ad(mutex_own(&(trx->undo_mutex)));
mtr_start_trx(&mtr, trx);
mtr_start(&mtr);
mutex_enter(&rseg->mutex);