mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Pre-requisite patch for bug #51263 "Deadlock between
transactional SELECT and ALTER TABLE ... REBUILD PARTITION". The goal of this patch is to decouple type of metadata lock acquired for table by open_tables() from type of table-level lock to be acquired on it. To achieve this we change approach to how we determine what type of metadata lock should be acquired on table to be open. Now instead of inferring it at open_tables() time from flags and type of table-level lock we rely on that type of metadata lock is properly set at parsing time and is not changed further.
This commit is contained in:
19
sql/table.h
19
sql/table.h
@ -1581,20 +1581,21 @@ struct TABLE_LIST
|
||||
OPEN_STUB
|
||||
} open_strategy;
|
||||
/**
|
||||
Indicates the locking strategy for the object being opened:
|
||||
whether the associated metadata lock is shared or exclusive.
|
||||
Indicates the locking strategy for the object being opened.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
/* Take a shared metadata lock before the object is opened. */
|
||||
SHARED_MDL= 0,
|
||||
/*
|
||||
Take a exclusive metadata lock before the object is opened.
|
||||
If opening is successful, downgrade to a shared lock.
|
||||
Take metadata lock specified by 'mdl_request' member before
|
||||
the object is opened. Do nothing after that.
|
||||
*/
|
||||
EXCLUSIVE_DOWNGRADABLE_MDL,
|
||||
/* Take a exclusive metadata lock before the object is opened. */
|
||||
EXCLUSIVE_MDL
|
||||
OTLS_NONE= 0,
|
||||
/*
|
||||
Take (exclusive) metadata lock specified by 'mdl_request' member
|
||||
before object is opened. If opening is successful, downgrade to
|
||||
a shared lock.
|
||||
*/
|
||||
OTLS_DOWNGRADE_IF_EXISTS
|
||||
} lock_strategy;
|
||||
/* For transactional locking. */
|
||||
int lock_timeout; /* NOWAIT or WAIT [X] */
|
||||
|
Reference in New Issue
Block a user