23#ifndef LOCKED_TABLES_LIST_INCLUDED
24#define LOCKED_TABLES_LIST_INCLUDED
123 bool remove_from_locked_tables);
125 size_t reopen_count);
128 const char *new_table_name,
Tables that were locked with LOCK TABLES statement.
Definition: locked_tables_list.h:88
bool init_locked_tables(THD *thd)
Enter LTM_LOCK_TABLES mode.
Definition: locked_tables_list.cc:49
void add_rename_tablespace_mdls(MDL_ticket *src, MDL_ticket *dst)
Definition: locked_tables_list.cc:426
MEM_ROOT m_locked_tables_root
Definition: locked_tables_list.h:90
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:235
void rename_locked_table(TABLE_LIST *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:369
Locked_tables_list()
Definition: locked_tables_list.cc:31
TABLE_LIST * locked_tables() const
Definition: locked_tables_list.h:121
TABLE_LIST * m_locked_tables
Definition: locked_tables_list.h:92
MDL_ticket_pairs m_rename_tablespace_mdls
Definition: locked_tables_list.h:110
void adjust_renamed_tablespace_mdls(MDL_context *mctx)
Definition: locked_tables_list.cc:451
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:286
TABLE_LIST ** m_locked_tables_last
Definition: locked_tables_list.h:93
size_t m_locked_tables_count
Count the number of tables in m_locked_tables list.
Definition: locked_tables_list.h:102
std::vector< MDL_ticket_pair > MDL_ticket_pairs
Definition: locked_tables_list.h:108
void discard_renamed_tablespace_mdls()
Definition: locked_tables_list.h:133
TABLE ** m_reopen_array
An auxiliary array used only in reopen_tables().
Definition: locked_tables_list.h:95
void unlock_locked_tables(THD *thd)
Leave LTM_LOCK_TABLES mode if it's been entered.
Definition: locked_tables_list.cc:124
~Locked_tables_list()
Definition: locked_tables_list.h:116
void unlink_from_list(const THD *thd, TABLE_LIST *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:191
Context of the owner of metadata locks.
Definition: mdl.h:1409
A granted metadata lock.
Definition: mdl.h:982
enum enum_locked_tables_mode locked_tables_mode
Definition: sql_class.h:649
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
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:9741
enum_locked_tables_mode
Type of locked tables mode.
Definition: locked_tables_list.h:46
@ LTM_PRELOCKED
Definition: locked_tables_list.h:49
@ LTM_LOCK_TABLES
Definition: locked_tables_list.h:48
@ LTM_PRELOCKED_UNDER_LOCK_TABLES
Definition: locked_tables_list.h:50
@ LTM_NONE
Definition: locked_tables_list.h:47
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:78
PSI_memory_key key_memory_locked_table_list
Definition: psi_memory_key.cc:114
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:127
Definition: locked_tables_list.h:104
MDL_ticket * m_dst
Definition: locked_tables_list.h:106
MDL_ticket * m_src
Definition: locked_tables_list.h:105
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82