MySQL 9.0.0
Source Code Documentation
|
Class that holds information about tables which were opened and locked by the thread. More...
#include <sql_class.h>
Public Types | |
enum | enum_flags { BACKUPS_AVAIL = (1U << 0) , SYSTEM_TABLES = (1U << 1) } |
Public Member Functions | |
Reprepare_observer * | get_reprepare_observer () const |
void | push_reprepare_observer (Reprepare_observer *o) |
Reprepare_observer * | pop_reprepare_observer () |
void | reset_reprepare_observers () |
Open_tables_state () | |
This constructor initializes Open_tables_state instance which can only be used as backup storage. More... | |
void | set_open_tables_state (Open_tables_state *state) |
void | reset_open_tables_state () |
Public Attributes | |
TABLE * | open_tables |
List of regular tables in use by this thread. More... | |
TABLE * | temporary_tables |
List of temporary tables used by this thread. More... | |
MYSQL_LOCK * | lock |
MYSQL_LOCK * | extra_lock |
enum enum_locked_tables_mode | locked_tables_mode |
uint | state_flags |
Private Attributes | |
Prealloced_array< Reprepare_observer *, 4 > | m_reprepare_observers |
A stack of Reprepare_observer-instances. More... | |
Class that holds information about tables which were opened and locked by the thread.
It is also used to save/restore this information in push_open_tables_state()/pop_open_tables_state().
|
inline |
This constructor initializes Open_tables_state instance which can only be used as backup storage.
To prepare Open_tables_state instance for operations which open/lock/close tables (e.g. open_table()) one has to call init_open_tables_state().
|
inline |
|
inline |
|
inline |
void Open_tables_state::reset_open_tables_state | ( | ) |
|
inline |
void Open_tables_state::set_open_tables_state | ( | Open_tables_state * | state | ) |
MYSQL_LOCK* Open_tables_state::extra_lock |
MYSQL_LOCK* Open_tables_state::lock |
enum enum_locked_tables_mode Open_tables_state::locked_tables_mode |
|
private |
A stack of Reprepare_observer-instances.
The top most instance is the currently active one. This stack is used during execution of prepared statements and stored programs in order to detect metadata changes. The locking subsystem reports a metadata change if the top-most item is not NULL.
When Open_tables_state part of THD is reset to open a system or INFORMATION_SCHEMA table, NULL is temporarily pushed to avoid spurious ER_NEED_REPREPARE errors – system and INFORMATION_SCHEMA tables are not subject to metadata version tracking.
A stack is used here for the convenience – in some cases we need to temporarily override/disable current Reprepare_observer-instance.
NOTE: This is not a list of observers, only the top-most element will be notified in case of a metadata change.
TABLE* Open_tables_state::open_tables |
List of regular tables in use by this thread.
Contains persistent base tables that were opened with
uint Open_tables_state::state_flags |
TABLE* Open_tables_state::temporary_tables |
List of temporary tables used by this thread.
Contains user-level temporary tables, created with CREATE TEMPORARY TABLE, and intermediate tables used in ALTER TABLE implementation.