MySQL 9.1.0
Source Code Documentation
|
#include <sql_lex.h>
Public Member Functions | |
Query_tables_list & | operator= (Query_tables_list &&)=default |
bool | is_query_tables_locked () const |
Query_tables_list ()=default | |
~Query_tables_list ()=default | |
void | reset_query_tables_list (bool init) |
void | destroy_query_tables_list () |
void | set_query_tables_list (Query_tables_list *state) |
void | add_to_query_tables (Table_ref *table) |
bool | requires_prelocking () |
void | mark_as_requiring_prelocking (Table_ref **tables_own_last) |
Table_ref * | first_not_own_table () |
void | chop_off_not_own_tables () |
bool | is_stmt_unsafe () const |
Determine if this statement is marked as unsafe. More... | |
bool | is_stmt_unsafe (enum_binlog_stmt_unsafe unsafe) |
void | set_stmt_unsafe (enum_binlog_stmt_unsafe unsafe_type) |
Flag the current (top-level) statement as unsafe. More... | |
void | set_stmt_unsafe_flags (uint32 flags) |
Set the bits of binlog_stmt_flags determining the type of unsafeness of the current statement. More... | |
uint32 | get_stmt_unsafe_flags () const |
Return a binary combination of all unsafe warnings for the statement. More... | |
bool | is_stmt_row_injection () const |
Determine if this statement is a row injection. More... | |
void | set_stmt_row_injection () |
Flag the statement as a row injection. More... | |
void | set_stmt_accessed_table (enum_stmt_accessed_table accessed_table) |
Sets the type of table that is about to be accessed while executing a statement. More... | |
bool | stmt_accessed_table (enum_stmt_accessed_table accessed_table) |
Checks if a type of table is about to be accessed while executing a statement. More... | |
bool | is_mixed_stmt_unsafe (bool in_multi_stmt_transaction_mode, bool binlog_direct, bool trx_cache_is_not_empty, uint tx_isolation) |
bool | uses_stored_routines () const |
true if the parsed tree contains references to stored procedures or functions, false otherwise More... | |
void | set_using_match () |
bool | get_using_match () |
void | set_stmt_unsafe_with_mixed_mode () |
bool | is_stmt_unsafe_with_mixed_mode () const |
Static Public Member Functions | |
static const char * | stmt_accessed_table_string (enum_stmt_accessed_table accessed_table) |
Public Attributes | |
enum_sql_command | sql_command |
SQL command for this statement. More... | |
Table_ref * | query_tables |
Table_ref ** | query_tables_last |
Table_ref ** | query_tables_own_last |
std::unique_ptr< malloc_unordered_map< std::string, Sroutine_hash_entry * > > | sroutines |
SQL_I_List< Sroutine_hash_entry > | sroutines_list |
Sroutine_hash_entry ** | sroutines_list_own_last |
uint | sroutines_list_own_elements |
enum_lock_tables_state | lock_tables_state |
uint | table_count |
Number of tables which were open by open_tables() and to be locked by lock_tables(). More... | |
Static Public Attributes | |
static const int | BINLOG_STMT_UNSAFE_ALL_FLAGS |
This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT (exclusive) set. More... | |
static const int | binlog_stmt_unsafe_errcode [BINLOG_STMT_UNSAFE_COUNT] |
Maps elements of enum_binlog_stmt_unsafe to error codes. More... | |
Private Types | |
enum | enum_binlog_stmt_type { BINLOG_STMT_TYPE_ROW_INJECTION = 0 , BINLOG_STMT_TYPE_COUNT } |
Enumeration listing special types of statements. More... | |
Private Attributes | |
uint32 | binlog_stmt_flags |
Bit field indicating the type of statement. More... | |
uint32 | stmt_accessed_table_flag |
Bit field that determines the type of tables that are about to be be accessed while executing a statement. More... | |
bool | using_match |
It will be set true if 'MATCH () AGAINST' is used in the statement. More... | |
bool | stmt_unsafe_with_mixed_mode {false} |
This flag is set to true if statement is unsafe to be binlogged in STATEMENT format, when in MIXED mode. More... | |
|
private |
Enumeration listing special types of statements.
Currently, the only possible type is ROW_INJECTION.
All types of unsafe statements.
Hence in practice this is not an enum at all, but a map from symbols to bit indexes.
The ordering of elements in this enum must correspond to the order of elements in the array binlog_stmt_unsafe_errcode.
Locking state of tables in this particular statement.
If we under LOCK TABLES or in prelocked mode we consider tables for the statement to be "locked" if there was a call to lock_tables() (which called handler::start_stmt()) for tables of this statement and there was no matching close_thread_tables() call.
As result this state may differ significantly from one represented by Open_tables_state::lock/locked_tables_mode more, which are always "on" under LOCK TABLES or in prelocked mode.
Enumerator | |
---|---|
LTS_NOT_LOCKED | |
LTS_LOCKED |
|
default |
|
default |
|
inline |
|
inline |
void Query_tables_list::destroy_query_tables_list | ( | ) |
|
inline |
|
inline |
Return a binary combination of all unsafe warnings for the statement.
If the statement has been marked as unsafe by the 'flag' member of enum_binlog_stmt_unsafe, then the return value from this function has bit (1<<flag) set to 1.
|
inline |
|
inline |
|
inline |
|
inline |
Determine if this statement is a row injection.
0 | if the statement is not a row injection |
nonzero | if the statement is a row injection |
|
inline |
Determine if this statement is marked as unsafe.
0 | if the statement is not marked as unsafe. |
nonzero | if the statement is marked as unsafe. |
|
inline |
|
inline |
|
inline |
|
default |
|
inline |
void Query_tables_list::reset_query_tables_list | ( | bool | init | ) |
|
inline |
|
inline |
Sets the type of table that is about to be accessed while executing a statement.
accessed_table | Enumeration type that defines the type of table, e.g. temporary, transactional, non-transactional. |
|
inline |
Flag the statement as a row injection.
A row injection is either a BINLOG statement, or a row event in the relay log executed by the slave SQL thread.
|
inline |
Flag the current (top-level) statement as unsafe.
The flag will be reset after the statement has finished.
unsafe_type | The type of unsafety: one of the BINLOG_STMT_FLAG_UNSAFE_* flags in enum_binlog_stmt_flag . |
|
inline |
Set the bits of binlog_stmt_flags determining the type of unsafeness of the current statement.
No existing bits will be cleared, but new bits may be set.
flags | A binary combination of zero or more bits, (1<<flag) where flag is a member of enum_binlog_stmt_unsafe. |
|
inline |
|
inline |
|
inline |
Checks if a type of table is about to be accessed while executing a statement.
accessed_table | Enumeration type that defines the type of table, e.g. temporary, transactional, non-transactional. |
true | if the type of the table is about to be accessed |
false | otherwise |
|
inlinestatic |
|
inline |
true if the parsed tree contains references to stored procedures or functions, false otherwise
|
private |
Bit field indicating the type of statement.
There are two groups of bits:
This must be a member of LEX, not of THD: each stored procedure needs to remember its unsafeness state between calls and each stored procedure has its own LEX object (but no own THD object).
|
static |
This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT (exclusive) set.
|
static |
Maps elements of enum_binlog_stmt_unsafe to error codes.
Mapping from enum values in enum_binlog_stmt_unsafe to error codes.
Todo/fixme Bug#22860121 ER_BINLOG_UNSAFE_* FAMILY OF ERROR CODES IS UNUSED suggests to turn ER_BINLOG_UNSAFE* to private consts/messages.
enum_lock_tables_state Query_tables_list::lock_tables_state |
Table_ref* Query_tables_list::query_tables |
Table_ref** Query_tables_list::query_tables_last |
Table_ref** Query_tables_list::query_tables_own_last |
enum_sql_command Query_tables_list::sql_command |
SQL command for this statement.
Part of this class since the process of opening and locking tables for the statement needs this information to determine correct type of lock for some of the tables.
std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *> > Query_tables_list::sroutines |
SQL_I_List<Sroutine_hash_entry> Query_tables_list::sroutines_list |
uint Query_tables_list::sroutines_list_own_elements |
Sroutine_hash_entry** Query_tables_list::sroutines_list_own_last |
|
private |
Bit field that determines the type of tables that are about to be be accessed while executing a statement.
|
private |
This flag is set to true if statement is unsafe to be binlogged in STATEMENT format, when in MIXED mode.
Currently this flag is set to true if stored program used in statement has CREATE/DROP temporary table operation(s) as sub-statement(s).
uint Query_tables_list::table_count |
Number of tables which were open by open_tables() and to be locked by lock_tables().
Note that we set this member only in some cases, when this value needs to be passed from open_tables() to lock_tables() which are separated by some amount of code.
|
private |
It will be set true if 'MATCH () AGAINST' is used in the statement.