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
ea46fdce
Commit
ea46fdce
authored
Jul 13, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup, remove dead code
parent
845c9396
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
65 deletions
+13
-65
include/thr_lock.h
include/thr_lock.h
+0
-2
mysys/thr_lock.c
mysys/thr_lock.c
+0
-46
sql/handler.h
sql/handler.h
+1
-2
sql/lock.cc
sql/lock.cc
+2
-3
sql/log_event_server.cc
sql/log_event_server.cc
+3
-4
sql/rpl_record.cc
sql/rpl_record.cc
+3
-3
sql/sql_table.cc
sql/sql_table.cc
+4
-5
No files found.
include/thr_lock.h
View file @
ea46fdce
...
...
@@ -173,8 +173,6 @@ void thr_print_locks(void); /* For debugging */
my_bool
thr_upgrade_write_delay_lock
(
THR_LOCK_DATA
*
data
,
enum
thr_lock_type
new_lock_type
,
ulong
lock_wait_timeout
);
void
thr_downgrade_write_lock
(
THR_LOCK_DATA
*
data
,
enum
thr_lock_type
new_lock_type
);
my_bool
thr_reschedule_write_lock
(
THR_LOCK_DATA
*
data
,
ulong
lock_wait_timeout
);
void
thr_set_lock_wait_callback
(
void
(
*
before_wait
)(
void
),
...
...
mysys/thr_lock.c
View file @
ea46fdce
...
...
@@ -1386,52 +1386,6 @@ my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread_id)
}
/*
Downgrade a WRITE_* to a lower WRITE level
SYNOPSIS
thr_downgrade_write_lock()
in_data Lock data of thread downgrading its lock
new_lock_type New write lock type
RETURN VALUE
NONE
DESCRIPTION
This can be used to downgrade a lock already owned. When the downgrade
occurs also other waiters, both readers and writers can be allowed to
start.
The previous lock is often TL_WRITE_ONLY but can also be
TL_WRITE. The normal downgrade variants are:
TL_WRITE_ONLY => TL_WRITE after a short exclusive lock while holding a
write table lock
TL_WRITE_ONLY => TL_WRITE_ALLOW_WRITE After a short exclusive lock after
already earlier having dongraded lock to TL_WRITE_ALLOW_WRITE
The implementation is conservative and rather don't start rather than
go on unknown paths to start, the common cases are handled.
NOTE:
In its current implementation it is only allowed to downgrade from
TL_WRITE_ONLY. In this case there are no waiters. Thus no wake up
logic is required.
*/
void
thr_downgrade_write_lock
(
THR_LOCK_DATA
*
in_data
,
enum
thr_lock_type
new_lock_type
)
{
THR_LOCK
*
lock
=
in_data
->
lock
;
#ifdef DBUG_ASSERT_EXISTS
enum
thr_lock_type
old_lock_type
=
in_data
->
type
;
#endif
DBUG_ENTER
(
"thr_downgrade_write_only_lock"
);
mysql_mutex_lock
(
&
lock
->
mutex
);
DBUG_ASSERT
(
old_lock_type
==
TL_WRITE_ONLY
);
DBUG_ASSERT
(
old_lock_type
>
new_lock_type
);
in_data
->
type
=
new_lock_type
;
check_locks
(
lock
,
"after downgrading lock"
,
old_lock_type
,
0
);
mysql_mutex_unlock
(
&
lock
->
mutex
);
DBUG_VOID_RETURN
;
}
/* Upgrade a WRITE_DELAY lock to a WRITE_LOCK */
my_bool
thr_upgrade_write_delay_lock
(
THR_LOCK_DATA
*
data
,
...
...
sql/handler.h
View file @
ea46fdce
...
...
@@ -4512,8 +4512,7 @@ class handler :public Sql_alloc
than lock_count() claimed. This can happen when the MERGE children
are not attached when this is called from another thread.
*/
virtual
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
virtual
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
)
=
0
;
/** Type of table for caching query */
...
...
sql/lock.cc
View file @
ea46fdce
...
...
@@ -816,9 +816,8 @@ MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, uint flags)
enum
thr_lock_type
lock_type
;
THR_LOCK_DATA
**
locks_start
;
if
(
!
((
likely
(
!
table
->
s
->
tmp_table
)
||
(
table
->
s
->
tmp_table
==
TRANSACTIONAL_TMP_TABLE
))
&&
(
!
(
flags
&
GET_LOCK_SKIP_SEQUENCES
)
||
table
->
s
->
sequence
==
0
)))
if
((
table
->
s
->
tmp_table
&&
table
->
s
->
tmp_table
!=
TRANSACTIONAL_TMP_TABLE
)
||
(
flags
&
GET_LOCK_SKIP_SEQUENCES
&&
table
->
s
->
sequence
!=
NULL
))
continue
;
lock_type
=
table
->
reginfo
.
lock_type
;
DBUG_ASSERT
(
lock_type
!=
TL_WRITE_DEFAULT
&&
lock_type
!=
TL_READ_DEFAULT
);
...
...
sql/log_event_server.cc
View file @
ea46fdce
...
...
@@ -6668,12 +6668,11 @@ is_duplicate_key_error(int errcode)
@c ha_update_row() or first deleted and then new record written.
*/
int
Rows_log_event
::
write_row
(
rpl_group_info
*
rgi
,
const
bool
overwrite
)
int
Rows_log_event
::
write_row
(
rpl_group_info
*
rgi
,
const
bool
overwrite
)
{
DBUG_ENTER
(
"write_row"
);
DBUG_ASSERT
(
m_table
!=
NULL
&&
thd
!=
NULL
);
DBUG_ASSERT
(
m_table
!=
NULL
);
DBUG_ASSERT
(
thd
!=
NULL
);
TABLE
*
table
=
m_table
;
// pointer to event's table
int
error
;
...
...
sql/rpl_record.cc
View file @
ea46fdce
...
...
@@ -218,8 +218,8 @@ static int fill_extra_persistent_columns(TABLE *table, int master_cols)
*/
int
unpack_row
(
rpl_group_info
*
rgi
,
TABLE
*
table
,
uint
const
colcnt
,
uchar
const
*
const
row_data
,
MY_BITMAP
const
*
cols
,
uchar
const
**
const
current_row_end
,
ulong
*
const
master_reclength
,
uchar
const
*
const
row_end
)
uchar
const
**
const
current_row_end
,
ulong
*
const
master_reclength
,
uchar
const
*
const
row_end
)
{
int
error
;
DBUG_ENTER
(
"unpack_row"
);
...
...
sql/sql_table.cc
View file @
ea46fdce
...
...
@@ -10026,8 +10026,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
*/
table_list
->
required_type
=
TABLE_TYPE_NORMAL
;
if
(
alter_info
->
requested_lock
==
Alter_info
::
ALTER_TABLE_LOCK_SHARED
||
alter_info
->
requested_lock
>
Alter_info
::
ALTER_TABLE_LOCK_NONE
if
(
alter_info
->
requested_lock
>
Alter_info
::
ALTER_TABLE_LOCK_NONE
||
alter_info
->
flags
&
ALTER_DROP_SYSTEM_VERSIONING
||
thd
->
lex
->
sql_command
==
SQLCOM_OPTIMIZE
||
alter_info
->
algorithm
(
thd
)
>
Alter_info
::
ALTER_TABLE_ALGORITHM_COPY
)
...
...
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