24#ifndef LOCKED_TABLES_LIST_INCLUDED
25#define LOCKED_TABLES_LIST_INCLUDED
124 bool remove_from_locked_tables);
126 size_t reopen_count);
129 const char *new_table_name,
Tables that were locked with LOCK TABLES statement.
Definition: locked_tables_list.h:89
bool init_locked_tables(THD *thd)
Enter LTM_LOCK_TABLES mode.
Definition: locked_tables_list.cc:52
void add_rename_tablespace_mdls(MDL_ticket *src, MDL_ticket *dst)
Definition: locked_tables_list.cc:428
MEM_ROOT m_locked_tables_root
Definition: locked_tables_list.h:91
Table_ref ** m_locked_tables_last
Definition: locked_tables_list.h:94
void unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count)
This is an attempt to recover (somewhat) in case of an error.
Definition: locked_tables_list.cc:237
Locked_tables_list()
Definition: locked_tables_list.cc:34
MDL_ticket_pairs m_rename_tablespace_mdls
Definition: locked_tables_list.h:111
void adjust_renamed_tablespace_mdls(MDL_context *mctx)
Definition: locked_tables_list.cc:453
void unlink_from_list(const THD *thd, Table_ref *table_list, bool remove_from_locked_tables)
Unlink a locked table from the locked tables list, either temporarily or permanently.
Definition: locked_tables_list.cc:194
bool reopen_tables(THD *thd)
Reopen the tables locked with LOCK TABLES and temporarily closed by a DDL statement or FLUSH TABLES.
Definition: locked_tables_list.cc:288
Table_ref * locked_tables() const
Definition: locked_tables_list.h:122
size_t m_locked_tables_count
Count the number of tables in m_locked_tables list.
Definition: locked_tables_list.h:103
std::vector< MDL_ticket_pair > MDL_ticket_pairs
Definition: locked_tables_list.h:109
void discard_renamed_tablespace_mdls()
Definition: locked_tables_list.h:134
Table_ref * m_locked_tables
Definition: locked_tables_list.h:93
TABLE ** m_reopen_array
An auxiliary array used only in reopen_tables().
Definition: locked_tables_list.h:96
void unlock_locked_tables(THD *thd)
Leave LTM_LOCK_TABLES mode if it's been entered.
Definition: locked_tables_list.cc:127
void rename_locked_table(Table_ref *old_table_list, const char *new_db, const char *new_table_name, MDL_ticket *target_mdl_ticket)
Update database and table names of table locked with LOCK TABLES after table rename.
Definition: locked_tables_list.cc:371
~Locked_tables_list()
Definition: locked_tables_list.h:117
Context of the owner of metadata locks.
Definition: mdl.h:1412
A granted metadata lock.
Definition: mdl.h:985
enum enum_locked_tables_mode locked_tables_mode
Definition: sql_class.h:662
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode)
Getter for the enum enum_locked_tables_mode.
Definition: binlog.cc:9871
enum_locked_tables_mode
Type of locked tables mode.
Definition: locked_tables_list.h:47
@ LTM_PRELOCKED
Definition: locked_tables_list.h:50
@ LTM_LOCK_TABLES
Definition: locked_tables_list.h:49
@ LTM_PRELOCKED_UNDER_LOCK_TABLES
Definition: locked_tables_list.h:51
@ LTM_NONE
Definition: locked_tables_list.h:48
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
PSI_memory_key key_memory_locked_table_list
Definition: psi_memory_key.cc:119
File containing constants that can be used throughout the server.
constexpr const size_t MEM_ROOT_BLOCK_SIZE
Memory allocated when parsing a statement.
Definition: sql_const.h:128
Definition: locked_tables_list.h:105
MDL_ticket * m_dst
Definition: locked_tables_list.h:107
MDL_ticket * m_src
Definition: locked_tables_list.h:106
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83