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:
@ -502,6 +502,7 @@ public:
|
||||
LEX_STRING *alias,
|
||||
ulong table_options,
|
||||
thr_lock_type flags= TL_UNLOCK,
|
||||
enum_mdl_type mdl_type= MDL_SHARED_READ,
|
||||
List<Index_hint> *hints= 0,
|
||||
LEX_STRING *option= 0);
|
||||
virtual void set_lock_for_tables(thr_lock_type lock_type) {}
|
||||
@ -799,6 +800,7 @@ public:
|
||||
LEX_STRING *alias,
|
||||
ulong table_options,
|
||||
thr_lock_type flags= TL_UNLOCK,
|
||||
enum_mdl_type mdl_type= MDL_SHARED_READ,
|
||||
List<Index_hint> *hints= 0,
|
||||
LEX_STRING *option= 0);
|
||||
TABLE_LIST* get_table_list();
|
||||
@ -2249,6 +2251,7 @@ public:
|
||||
yacc_yyvs= NULL;
|
||||
m_set_signal_info.clear();
|
||||
m_lock_type= TL_READ_DEFAULT;
|
||||
m_mdl_type= MDL_SHARED_READ;
|
||||
}
|
||||
|
||||
~Yacc_state();
|
||||
@ -2260,6 +2263,7 @@ public:
|
||||
void reset_before_substatement()
|
||||
{
|
||||
m_lock_type= TL_READ_DEFAULT;
|
||||
m_mdl_type= MDL_SHARED_READ;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2299,6 +2303,12 @@ public:
|
||||
*/
|
||||
thr_lock_type m_lock_type;
|
||||
|
||||
/**
|
||||
The type of requested metadata lock for tables added to
|
||||
the statement table list.
|
||||
*/
|
||||
enum_mdl_type m_mdl_type;
|
||||
|
||||
/*
|
||||
TODO: move more attributes from the LEX structure here.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user