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
bd52f1a2
Commit
bd52f1a2
authored
Jan 04, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Remove lock_number_of_rows_locked()
Let us access trx->lock.n_rec_locks directly.
parent
3dabe637
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
45 deletions
+24
-45
storage/innobase/include/lock0lock.h
storage/innobase/include/lock0lock.h
+1
-11
storage/innobase/include/lock0priv.h
storage/innobase/include/lock0priv.h
+5
-3
storage/innobase/include/lock0priv.ic
storage/innobase/include/lock0priv.ic
+3
-2
storage/innobase/include/trx0i_s.h
storage/innobase/include/trx0i_s.h
+2
-2
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+4
-3
storage/innobase/lock/lock0lock.cc
storage/innobase/lock/lock0lock.cc
+2
-17
storage/innobase/row/row0ins.cc
storage/innobase/row/row0ins.cc
+2
-2
storage/innobase/trx/trx0i_s.cc
storage/innobase/trx/trx0i_s.cc
+2
-2
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+3
-3
No files found.
storage/innobase/include/lock0lock.h
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 202
0
, MariaDB Corporation.
Copyright (c) 2017, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -534,16 +534,6 @@ void
lock_print_info_all_transactions
(
/*=============================*/
FILE
*
file
);
/*!< in: file where to print */
/*********************************************************************//**
Return approximate number or record locks (bits set in the bitmap) for
this transaction. Since delete-marked records may be removed, the
record count will not be precise.
The caller must be holding lock_sys.mutex. */
ulint
lock_number_of_rows_locked
(
/*=======================*/
const
trx_lock_t
*
trx_lock
)
/*!< in: transaction locks */
MY_ATTRIBUTE
((
warn_unused_result
));
/*********************************************************************//**
Return the number of table locks for a transaction.
...
...
storage/innobase/include/lock0priv.h
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 20
18
, MariaDB Corporation.
Copyright (c) 2015, 20
21
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -515,6 +515,7 @@ lock_rec_set_nth_bit(
@return previous value of the bit */
inline
byte
lock_rec_reset_nth_bit
(
lock_t
*
lock
,
ulint
i
)
{
lock_sys
.
mutex_assert_locked
();
ut_ad
(
lock_get_type_low
(
lock
)
==
LOCK_REC
);
ut_ad
(
i
<
lock
->
un_member
.
rec_lock
.
n_bits
);
...
...
@@ -524,8 +525,9 @@ inline byte lock_rec_reset_nth_bit(lock_t* lock, ulint i)
*
b
&=
byte
(
~
mask
);
if
(
bit
!=
0
)
{
ut_ad
(
lock
->
trx
->
lock
.
n_rec_locks
>
0
);
--
lock
->
trx
->
lock
.
n_rec_locks
;
ut_d
(
auto
n
=
)
lock
->
trx
->
lock
.
n_rec_locks
--
;
ut_ad
(
n
);
}
return
(
bit
);
...
...
storage/innobase/include/lock0priv.ic
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, 202
0
, MariaDB Corporation.
Copyright (c) 2018, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -91,6 +91,7 @@ lock_rec_set_nth_bit(
ulint
byte_index
;
ulint
bit_index
;
lock_sys
.
mutex_assert_locked
();
ut_ad
(
lock
);
ut_ad
(
lock_get_type_low
(
lock
)
==
LOCK_REC
);
ut_ad
(
i
<
lock
->
un_member
.
rec_lock
.
n_bits
);
...
...
@@ -106,7 +107,7 @@ lock_rec_set_nth_bit(
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
++
lock
->
trx
->
lock
.
n_rec_locks
;
lock
->
trx
->
lock
.
n_rec_locks
++
;
}
/*********************************************************************//**
...
...
storage/innobase/include/trx0i_s.h
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 202
0
, MariaDB Corporation.
Copyright (c) 2017, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -138,7 +138,7 @@ struct i_s_trx_row_t {
ulint
trx_lock_memory_bytes
;
/*!< mem_heap_get_size(
trx->lock_heap) */
ulint
trx_rows_locked
;
/*!<
lock_number_of_rows_locked()
*/
ulint
trx_rows_locked
;
/*!<
trx_lock_t::n_rec_locks
*/
uintmax_t
trx_rows_modified
;
/*!< trx_t::undo_no */
uint
trx_isolation_level
;
/*!< trx_t::isolation_level */
...
...
storage/innobase/include/trx0trx.h
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 202
0
, MariaDB Corporation.
Copyright (c) 2015, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -245,7 +245,7 @@ trx_print_low(
/*!< in: max query length to print,
or 0 to use the default max length */
ulint
n_rec_locks
,
/*!< in:
lock_number_of_rows_locked(&trx->lock)
*/
/*!< in:
trx->lock.n_rec_locks
*/
ulint
n_trx_locks
,
/*!< in: length of trx->lock.trx_locks */
ulint
heap_size
);
...
...
@@ -560,7 +560,8 @@ struct trx_lock_t {
mutex to prevent recursive deadlocks.
Protected by both the lock sys mutex
and the trx_t::mutex. */
ulint
n_rec_locks
;
/*!< number of rec locks in this trx */
/** number of record locks; writes are protected by lock_sys.mutex */
ulint
n_rec_locks
;
}
;
/** Logical first modification time of a table in a transaction */
...
...
storage/innobase/lock/lock0lock.cc
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 202
0
, MariaDB Corporation.
Copyright (c) 2014, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -1157,21 +1157,6 @@ lock_sec_rec_some_has_impl(
return
(
trx
);
}
/*********************************************************************//**
Return approximate number or record locks (bits set in the bitmap) for
this transaction. Since delete-marked records may be removed, the
record count will not be precise.
The caller must be holding lock_sys.mutex. */
ulint
lock_number_of_rows_locked
(
/*=======================*/
const
trx_lock_t
*
trx_lock
)
/*!< in: transaction locks */
{
lock_sys
.
mutex_assert_locked
();
return
(
trx_lock
->
n_rec_locks
);
}
/*********************************************************************//**
Return the number of table locks for a transaction.
The caller must be holding lock_sys.mutex. */
...
...
@@ -5940,7 +5925,7 @@ DeadlockChecker::print(const trx_t* trx, ulint max_query_len)
{
lock_sys
.
mutex_assert_locked
();
ulint
n_rec_locks
=
lock_number_of_rows_locked
(
&
trx
->
lock
)
;
ulint
n_rec_locks
=
trx
->
lock
.
n_rec_locks
;
ulint
n_trx_locks
=
UT_LIST_GET_LEN
(
trx
->
lock
.
trx_locks
);
ulint
heap_size
=
mem_heap_get_size
(
trx
->
lock
.
lock_heap
);
...
...
storage/innobase/row/row0ins.cc
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 202
0
, MariaDB Corporation.
Copyright (c) 2016, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -705,7 +705,7 @@ row_ins_foreign_trx_print(
ut_ad
(
!
srv_read_only_mode
);
lock_sys
.
mutex_lock
();
n_rec_locks
=
lock_number_of_rows_locked
(
&
trx
->
lock
)
;
n_rec_locks
=
trx
->
lock
.
n_rec_locks
;
n_trx_locks
=
UT_LIST_GET_LEN
(
trx
->
lock
.
trx_locks
);
heap_size
=
mem_heap_get_size
(
trx
->
lock
.
lock_heap
);
lock_sys
.
mutex_unlock
();
...
...
storage/innobase/trx/trx0i_s.cc
View file @
bd52f1a2
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 202
0
, MariaDB Corporation.
Copyright (c) 2017, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -487,7 +487,7 @@ fill_trx_row(
row
->
trx_lock_memory_bytes
=
mem_heap_get_size
(
trx
->
lock
.
lock_heap
);
row
->
trx_rows_locked
=
lock_number_of_rows_locked
(
&
trx
->
lock
)
;
row
->
trx_rows_locked
=
trx
->
lock
.
n_rec_locks
;
row
->
trx_rows_modified
=
trx
->
undo_no
;
...
...
storage/innobase/trx/trx0trx.cc
View file @
bd52f1a2
...
...
@@ -1761,7 +1761,7 @@ trx_print_low(
/*!< in: max query length to print,
or 0 to use the default max length */
ulint
n_rec_locks
,
/*!< in:
lock_number_of_rows_locked(&trx->lock)
*/
/*!< in:
trx->lock.n_rec_locks
*/
ulint
n_trx_locks
,
/*!< in: length of trx->lock.trx_locks */
ulint
heap_size
)
...
...
@@ -1872,7 +1872,7 @@ trx_print_latched(
lock_sys
.
mutex_assert_locked
();
trx_print_low
(
f
,
trx
,
max_query_len
,
lock_number_of_rows_locked
(
&
trx
->
lock
)
,
trx
->
lock
.
n_rec_locks
,
UT_LIST_GET_LEN
(
trx
->
lock
.
trx_locks
),
mem_heap_get_size
(
trx
->
lock
.
lock_heap
));
}
...
...
@@ -1893,7 +1893,7 @@ trx_print(
ulint
heap_size
;
lock_sys
.
mutex_lock
();
n_rec_locks
=
lock_number_of_rows_locked
(
&
trx
->
lock
)
;
n_rec_locks
=
trx
->
lock
.
n_rec_locks
;
n_trx_locks
=
UT_LIST_GET_LEN
(
trx
->
lock
.
trx_locks
);
heap_size
=
mem_heap_get_size
(
trx
->
lock
.
lock_heap
);
lock_sys
.
mutex_unlock
();
...
...
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