mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
Cleanup: More use of mtr_memo_type_t
This commit is contained in:
parent
ae90f8431b
commit
786b004972
5 changed files with 16 additions and 13 deletions
|
@ -2345,7 +2345,9 @@ need_opposite_intention:
|
|||
? RW_X_LATCH : RW_SX_LATCH, false, mtr);
|
||||
btr_assert_not_corrupted(child_block, index);
|
||||
} else {
|
||||
ut_ad(mtr_memo_contains(mtr, block, upper_rw_latch));
|
||||
ut_ad(mtr_memo_contains(mtr, block,
|
||||
static_cast<mtr_memo_type_t>
|
||||
(upper_rw_latch)));
|
||||
btr_assert_not_corrupted(block, index);
|
||||
|
||||
if (s_latch_by_caller) {
|
||||
|
@ -2671,8 +2673,8 @@ btr_cur_open_at_index_side_func(
|
|||
ut_ad(latch_mode == BTR_SEARCH_TREE);
|
||||
ut_ad(s_latch_by_caller);
|
||||
ut_ad(upper_rw_latch == RW_S_LATCH);
|
||||
|
||||
ut_ad(mtr_memo_contains(mtr, block, upper_rw_latch));
|
||||
ut_ad(mtr_memo_contains(mtr, block,
|
||||
MTR_MEMO_PAGE_S_FIX));
|
||||
|
||||
if (s_latch_by_caller) {
|
||||
/* to exclude modifying tree operations
|
||||
|
|
|
@ -185,7 +185,7 @@ btr_leaf_page_release(
|
|||
|
||||
ut_ad(!mtr_memo_contains(mtr, block, MTR_MEMO_MODIFY));
|
||||
|
||||
ulint mode;
|
||||
mtr_memo_type_t mode;
|
||||
switch (latch_mode) {
|
||||
case BTR_SEARCH_LEAF:
|
||||
mode = MTR_MEMO_PAGE_S_FIX;
|
||||
|
|
|
@ -119,8 +119,8 @@ struct mtr_memo_slot_t {
|
|||
/** pointer to the object */
|
||||
void* object;
|
||||
|
||||
/** type of the stored object (MTR_MEMO_S_LOCK, ...) */
|
||||
ulint type;
|
||||
/** type of the stored object */
|
||||
mtr_memo_type_t type;
|
||||
};
|
||||
|
||||
/** Mini-transaction handle and buffer */
|
||||
|
@ -301,7 +301,7 @@ struct mtr_t {
|
|||
|
||||
/** Release an object in the memo stack.
|
||||
@param object object
|
||||
@param type object type: MTR_MEMO_S_LOCK, ...
|
||||
@param type object type
|
||||
@return bool if lock released */
|
||||
bool memo_release(const void* object, ulint type);
|
||||
/** Release a page latch.
|
||||
|
@ -354,13 +354,13 @@ struct mtr_t {
|
|||
#ifdef UNIV_DEBUG
|
||||
/** Check if memo contains the given item.
|
||||
@param memo memo stack
|
||||
@param object, object to search
|
||||
@param object object to search
|
||||
@param type type of object
|
||||
@return true if contains */
|
||||
static bool memo_contains(
|
||||
const mtr_buf_t* memo,
|
||||
const void* object,
|
||||
ulint type)
|
||||
mtr_memo_type_t type)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
/** Check if memo contains the given item.
|
||||
|
|
|
@ -255,8 +255,7 @@ mach_write_to_8(checkpoint_lsn). */
|
|||
#define SIZE_OF_MLOG_CHECKPOINT 9
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/** Types for the mlock objects to store in the mtr memo; NOTE that the
|
||||
first 3 values must be RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
|
||||
/** Types for the mlock objects to store in the mtr_t::m_memo */
|
||||
enum mtr_memo_type_t {
|
||||
MTR_MEMO_PAGE_S_FIX = RW_S_LATCH,
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ struct Find {
|
|||
mtr_memo_slot_t*m_slot;
|
||||
|
||||
/** Type of the object to look for */
|
||||
ulint m_type;
|
||||
const ulint m_type;
|
||||
|
||||
/** The object instance to look for */
|
||||
const void* m_object;
|
||||
|
@ -728,7 +728,7 @@ bool
|
|||
mtr_t::memo_contains(
|
||||
const mtr_buf_t* memo,
|
||||
const void* object,
|
||||
ulint type)
|
||||
mtr_memo_type_t type)
|
||||
{
|
||||
Iterate<Find> iteration(Find(object, type));
|
||||
if (memo->for_each_block_in_reverse(iteration)) {
|
||||
|
@ -745,6 +745,8 @@ mtr_t::memo_contains(
|
|||
case MTR_MEMO_S_LOCK:
|
||||
ut_ad(rw_lock_own((rw_lock_t*) object, RW_LOCK_S));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue