Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
786b0049
Commit
786b0049
authored
Nov 15, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: More use of mtr_memo_type_t
parent
ae90f843
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
storage/innobase/btr/btr0cur.cc
storage/innobase/btr/btr0cur.cc
+5
-3
storage/innobase/include/btr0btr.ic
storage/innobase/include/btr0btr.ic
+1
-1
storage/innobase/include/mtr0mtr.h
storage/innobase/include/mtr0mtr.h
+5
-5
storage/innobase/include/mtr0types.h
storage/innobase/include/mtr0types.h
+1
-2
storage/innobase/mtr/mtr0mtr.cc
storage/innobase/mtr/mtr0mtr.cc
+4
-2
No files found.
storage/innobase/btr/btr0cur.cc
View file @
786b0049
...
...
@@ -2345,7 +2345,9 @@ btr_cur_search_to_nth_level_func(
?
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
...
...
storage/innobase/include/btr0btr.ic
View file @
786b0049
...
...
@@ -185,7 +185,7 @@ btr_leaf_page_release(
ut_ad(!mtr_memo_contains(mtr, block, MTR_MEMO_MODIFY));
ulin
t mode;
mtr_memo_type_
t mode;
switch (latch_mode) {
case BTR_SEARCH_LEAF:
mode = MTR_MEMO_PAGE_S_FIX;
...
...
storage/innobase/include/mtr0mtr.h
View file @
786b0049
...
...
@@ -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.
...
...
storage/innobase/include/mtr0types.h
View file @
786b0049
...
...
@@ -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
,
...
...
storage/innobase/mtr/mtr0mtr.cc
View file @
786b0049
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment