24#ifndef THD_RAII_INCLUDED
25#define THD_RAII_INCLUDED 1
125 thd->is_operating_substatement_implicitly),
138 bool disable_gtid_and_spco =
139 (
mode != enum_implicit_substatement_guard_mode ::
140 ENABLE_GTID_AND_SPCO_IF_SPCO_ACTIVE);
169 thd->
variables.option_bits &= ~OPTION_BIN_LOG;
306template <
typename Error_handler,
typename Error_handler_arg>
338 bool activate_now_if_needed =
true)
uint32_t Access_bitmask
Definition: auth_acls.h:34
RAII class for column privilege checking.
Definition: thd_raii.h:393
THD *const m_thd
Definition: thd_raii.h:402
const Access_bitmask m_saved_privilege
Definition: thd_raii.h:403
~Column_privilege_tracker()
Definition: thd_raii.h:399
Column_privilege_tracker(THD *thd, Access_bitmask privilege)
Definition: thd_raii.h:395
RAII class for temporarily turning off @autocommit in the connection.
Definition: thd_raii.h:50
Disable_autocommit_guard(THD *thd)
Definition: thd_raii.h:57
ulonglong m_save_option_bits
Definition: thd_raii.h:89
THD * m_thd
Definition: thd_raii.h:88
~Disable_autocommit_guard()
Definition: thd_raii.h:72
RAII class to temporarily disable binlogging.
Definition: thd_raii.h:164
THD *const m_thd
Definition: thd_raii.h:177
~Disable_binlog_guard()
Definition: thd_raii.h:172
Disable_binlog_guard(THD *thd)
Definition: thd_raii.h:166
const bool m_binlog_disabled
Definition: thd_raii.h:178
Definition: thd_raii.h:181
~Disable_sql_log_bin_guard()
Definition: thd_raii.h:188
Disable_sql_log_bin_guard(THD *thd)
Definition: thd_raii.h:183
THD *const m_thd
Definition: thd_raii.h:193
const bool m_saved_sql_log_bin
Definition: thd_raii.h:194
RAII class to temporarily enable derived_merge optimizer_switch for SHOW commands that are based on I...
Definition: thd_raii.h:410
Enable_derived_merge_guard(THD *thd, bool enable_derived_merge)
Definition: thd_raii.h:412
bool m_derived_merge
Definition: thd_raii.h:427
THD *const m_thd
Definition: thd_raii.h:426
~Enable_derived_merge_guard()
Definition: thd_raii.h:420
ulonglong m_save_optimizer_switch
Definition: thd_raii.h:428
RAII class which allows to temporary disable updating Gtid_state and disable invocation of commit ord...
Definition: thd_raii.h:107
THD * m_thd
Definition: thd_raii.h:154
bool m_guard_ignored
Definition: thd_raii.h:157
bool m_save_is_operating_substatement_implicitly
Definition: thd_raii.h:155
bool m_save_skip_gtid_rollback
Definition: thd_raii.h:156
Implicit_substatement_state_guard(THD *thd, enum_implicit_substatement_guard_mode mode=enum_implicit_substatement_guard_mode::DISABLE_GTID_AND_SPCO)
Constructs a new object and set thd->is_operating_substatement_implicitly and thd->skip_gtid_rollback...
Definition: thd_raii.h:119
~Implicit_substatement_state_guard()
Definition: thd_raii.h:145
A simple holder for Internal_error_handler.
Definition: thd_raii.h:307
~Internal_error_handler_holder()
Definition: thd_raii.h:318
bool m_activate
Definition: thd_raii.h:309
Error_handler m_error_handler
Definition: thd_raii.h:310
THD * m_thd
Definition: thd_raii.h:308
Internal_error_handler_holder(THD *thd, bool activate, Error_handler_arg *arg)
Definition: thd_raii.h:313
A simple holder for the Prepared Statement Query_arena instance in THD.
Definition: thd_raii.h:327
Query_arena * m_arena
The arena set by this holder (by activate()).
Definition: thd_raii.h:362
~Prepared_stmt_arena_holder()
Deactivate the persistent arena (restore the previous arena) if it has been activated.
Definition: thd_raii.h:351
Prepared_stmt_arena_holder(THD *thd, bool activate_now_if_needed=true)
Constructs a new object, activates the persistent arena if requested and if a prepared statement or a...
Definition: thd_raii.h:337
THD *const m_thd
The thread context to work with.
Definition: thd_raii.h:359
Query_arena m_backup
The arena state to be restored.
Definition: thd_raii.h:365
bool is_activated() const
Definition: thd_raii.h:355
RAII class for pushed LEX object.
Definition: thd_raii.h:371
~Pushed_lex_guard()
Definition: thd_raii.h:377
THD *const m_thd
Definition: thd_raii.h:386
LEX * m_old_lex
Definition: thd_raii.h:387
Pushed_lex_guard(THD *thd, LEX *new_lex)
Definition: thd_raii.h:373
Definition: sql_class.h:343
bool is_regular() const
Definition: sql_class.h:415
void swap_query_arena(const Query_arena &source, Query_arena *backup)
Copy the current arena to backup and set the current arena to match source
Definition: sql_class.cc:2029
MEM_ROOT * mem_root
Definition: sql_class.h:352
enum_sql_command sql_command
SQL command for this statement.
Definition: sql_lex.h:2517
RAII class to temporarily turn off SQL modes that affect parsing of expressions.
Definition: thd_raii.h:239
THD * m_thd
Definition: thd_raii.h:276
const sql_mode_t m_old_sql_mode
Definition: thd_raii.h:277
~Sql_mode_parse_guard()
Definition: thd_raii.h:273
Sql_mode_parse_guard(THD *thd)
Definition: thd_raii.h:241
RAII class to temporarily swap thd->mem_root to a different mem_root.
Definition: thd_raii.h:283
MEM_ROOT * m_old_mem_root
Definition: thd_raii.h:296
~Swap_mem_root_guard()
Definition: thd_raii.h:290
THD * m_thd
Definition: thd_raii.h:295
Swap_mem_root_guard(THD *thd, MEM_ROOT *mem_root)
Definition: thd_raii.h:285
MEM_ROOT * old_mem_root()
Definition: thd_raii.h:292
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Query_arena * stmt_arena
Definition: sql_class.h:2104
LEX * lex
Definition: sql_class.h:981
Internal_error_handler * pop_internal_handler()
Remove the error handler last pushed.
Definition: sql_class.cc:912
void clear_current_stmt_binlog_format_row()
Definition: sql_class.h:3412
int is_current_stmt_binlog_format_row() const
Determine the binlog format of the current statement.
Definition: sql_class.h:1707
void push_internal_handler(Internal_error_handler *handler)
Add an internal error handler to the thread execution context.
Definition: sql_class.cc:891
void set_current_stmt_binlog_format_row()
Definition: sql_class.h:3407
bool skip_gtid_rollback
Definition: sql_class.h:3845
System_variables variables
Definition: sql_lexer_thd.h:62
Access_bitmask want_privilege
Used by Item::check_column_privileges() to tell which privileges to check for.
Definition: sql_class.h:969
MEM_ROOT * mem_root
Definition: sql_lexer_thd.h:38
Transaction_ctx * get_transaction()
Definition: sql_class.h:2045
bool is_operating_substatement_implicitly
Definition: sql_class.h:2288
bool is_empty(enum_trx_scope scope) const
Definition: transaction_info.h:331
@ SESSION
Definition: transaction_info.h:55
@ STMT
Definition: transaction_info.h:55
static MEM_ROOT mem_root
Definition: client_plugin.cc:110
ulonglong sql_mode_t
Definition: dd_event.h:37
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
void lex_end(LEX *lex)
Call this function after preparation and execution of a query.
Definition: sql_lex.cc:535
bool lex_start(THD *thd)
Call lex_start() before every query that is to be prepared and executed.
Definition: sql_lex.cc:511
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
@ SQLCOM_CREATE_TABLE
Definition: my_sqlcommand.h:48
static const char * sql_mode
Definition: mysqlslap.cc:197
mode
Definition: file_handle.h:60
#define OPTION_BIN_LOG
Definition: query_options.h:73
#define OPTION_NOT_AUTOCOMMIT
Definition: query_options.h:74
bool has_commit_order_manager(const THD *thd)
Determines whether current thread shall run the procedure here to check whether it waits for its turn...
Definition: rpl_replica_commit_order_manager.cc:503
constexpr const uint64_t OPTIMIZER_SWITCH_DERIVED_MERGE
Definition: sql_const.h:217
Definition: mysql_command_services_imp.cc:42
bool m_transactional_ddl
Definition: handler.h:3122
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3710
HA_CREATE_INFO * create_info
Definition: sql_lex.h:3884
void cleanup(bool full)
Definition: sql_lex.h:4101
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
sql_mode_t sql_mode
Definition: sql_lexer_thd.h:56
#define MODE_IGNORE_SPACE
Definition: system_variables.h:132
#define MODE_ANSI_QUOTES
Definition: system_variables.h:131
#define MODE_PIPES_AS_CONCAT
Definition: system_variables.h:130
#define MODE_NO_BACKSLASH_ESCAPES
Definition: system_variables.h:139
enum_binlog_format
Definition: system_variables.h:45
@ BINLOG_FORMAT_ROW
row-based
Definition: system_variables.h:48
@ BINLOG_FORMAT_STMT
statement-based
Definition: system_variables.h:47
static task_env * activate(task_env *t)
Definition: task.cc:530
enum_implicit_substatement_guard_mode
The mode for Implicit_substatement_state_guard based on which it determine whether to enable or disab...
Definition: thd_raii.h:97
@ DISABLE_GTID_AND_SPCO_IF_SPCO_ACTIVE
@ ENABLE_GTID_AND_SPCO_IF_SPCO_ACTIVE