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
74ab97f5
Commit
74ab97f5
authored
Feb 07, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Remove lock_trx_lock_list_init(), lock_table_get_n_locks()
parent
487fbc2e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
50 deletions
+7
-50
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+6
-5
storage/innobase/include/lock0lock.h
storage/innobase/include/lock0lock.h
+0
-13
storage/innobase/lock/lock0lock.cc
storage/innobase/lock/lock0lock.cc
+0
-30
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+1
-2
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
74ab97f5
...
...
@@ -2692,17 +2692,18 @@ static bool innobase_query_caching_table_check_low(
For read-only transaction: should satisfy (1) and (3)
For read-write transaction: should satisfy (1), (2), (3) */
if
(
lock_table_get_n_locks
(
table
)
)
{
if
(
trx
->
id
&&
trx
->
id
<
table
->
query_cache_inv_trx_id
)
{
return
false
;
}
if
(
trx
->
id
&&
trx
->
id
<
table
->
query_cache_inv_trx_id
)
{
if
(
trx
->
read_view
.
is_open
()
&&
trx
->
read_view
.
low_limit_id
()
<
table
->
query_cache_inv_trx_id
)
{
return
false
;
}
return
!
trx
->
read_view
.
is_open
()
||
trx
->
read_view
.
low_limit_id
()
>=
table
->
query_cache_inv_trx_id
;
LockMutexGuard
g
;
return
UT_LIST_GET_LEN
(
table
->
locks
)
==
0
;
}
/** Checks if MySQL at the moment is allowed for this table to retrieve a
...
...
storage/innobase/include/lock0lock.h
View file @
74ab97f5
...
...
@@ -564,19 +564,6 @@ dberr_t
lock_trx_handle_wait
(
/*=================*/
trx_t
*
trx
);
/*!< in/out: trx lock state */
/*********************************************************************//**
Get the number of locks on a table.
@return number of locks */
ulint
lock_table_get_n_locks
(
/*===================*/
const
dict_table_t
*
table
);
/*!< in: table */
/*******************************************************************//**
Initialise the trx lock list. */
void
lock_trx_lock_list_init
(
/*====================*/
trx_lock_list_t
*
lock_list
);
/*!< List to initialise */
/*********************************************************************//**
Checks that a transaction id is sensible, i.e., not in the future.
...
...
storage/innobase/lock/lock0lock.cc
View file @
74ab97f5
...
...
@@ -5621,25 +5621,6 @@ lock_trx_handle_wait(
return
err
;
}
/*********************************************************************//**
Get the number of locks on a table.
@return number of locks */
ulint
lock_table_get_n_locks
(
/*===================*/
const
dict_table_t
*
table
)
/*!< in: table */
{
ulint
n_table_locks
;
lock_sys
.
mutex_lock
();
n_table_locks
=
UT_LIST_GET_LEN
(
table
->
locks
);
lock_sys
.
mutex_unlock
();
return
(
n_table_locks
);
}
#ifdef UNIV_DEBUG
/**
Do an exhaustive check for any locks (table or rec) against the table.
...
...
@@ -5719,17 +5700,6 @@ lock_table_lock_list_init(
UT_LIST_INIT
(
*
lock_list
,
&
lock_table_t
::
locks
);
}
/*******************************************************************//**
Initialise the trx lock list. */
void
lock_trx_lock_list_init
(
/*====================*/
trx_lock_list_t
*
lock_list
)
/*!< List to initialise */
{
UT_LIST_INIT
(
*
lock_list
,
&
lock_t
::
trx_locks
);
}
#ifdef UNIV_DEBUG
/*******************************************************************//**
Check if the transaction holds any locks on the sys tables
...
...
storage/innobase/trx/trx0trx.cc
View file @
74ab97f5
...
...
@@ -186,8 +186,7 @@ struct TrxFactory {
1024
,
MEM_HEAP_FOR_LOCK_HEAP
);
pthread_cond_init
(
&
trx
->
lock
.
cond
,
nullptr
);
lock_trx_lock_list_init
(
&
trx
->
lock
.
trx_locks
);
UT_LIST_INIT
(
trx
->
lock
.
trx_locks
,
&
lock_t
::
trx_locks
);
UT_LIST_INIT
(
trx
->
lock
.
evicted_tables
,
&
dict_table_t
::
table_LRU
);
...
...
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