24#ifndef SQL_CLASS_INCLUDED
25#define SQL_CLASS_INCLUDED
51#include <unordered_map>
85#include "mysqld_error.h"
148class Dictionary_client;
151class DD_kill_immunizer;
171 const char *src_function,
const char *src_file,
174 const char *src_function,
const char *src_file,
180 const char *src_function,
const char *src_file,
186#define THD_STAGE_INFO(thd, stage) \
187 (thd)->enter_stage(&stage, NULL, __func__, __FILE__, __LINE__)
343#define THD_SENTRY_MAGIC 0xfeedd1ff
344#define THD_SENTRY_GONE 0xdeadbeef
346#define THD_CHECK_SENTRY(thd) assert(thd->dbug_sentry == THD_SENTRY_MAGIC)
428 template <
typename T>
430 void *m =
alloc(
sizeof(T));
431 return m ==
nullptr ?
nullptr :
new (m) T;
433 template <
typename T>
740#define SUB_STMT_TRIGGER 1
741#define SUB_STMT_FUNCTION 2
760#define RETURN_NAME_AS_STRING(NAME) \
780 sprintf(
buf,
"<UNKNOWN SYSTEM THREAD: %d>", thread);
783#undef RETURN_NAME_AS_STRING
889 assert(
m_thd !=
nullptr);
921 std::pair<Event_tracking_class, Event_tracking_information *>;
1070 std::unique_ptr<Secondary_engine_statement_context>
1104 std::unique_ptr<Secondary_engine_statement_context> context);
1385 return pointer_cast<const Protocol_classic *>(
m_protocol);
1508 const char *calling_func,
const char *calling_file,
1746 bool binlog_rows_query);
1749 const unsigned char *extra_row_info);
1751 const uchar *old_data,
1752 const unsigned char *extra_row_info);
1755 const uchar *extra_row_info);
1761 template <
class RowsEventT>
1764 const unsigned char *extra_row_info,
uint32 source_part_id = INT_MAX);
2489#if defined(ENABLED_PROFILING)
2504#ifdef HAVE_PSI_STATEMENT_INTERFACE
2511#ifdef HAVE_PSI_TRANSACTION_INTERFACE
2518#ifdef HAVE_PSI_IDLE_INTERFACE
2669 assert(((
file ==
nullptr) && (pos == 0)) ||
2670 ((
file !=
nullptr) && (pos != 0)));
2686 (
"m_trans_log_file: %s, m_trans_fixed_log_file: %s, "
2687 "m_trans_end_pos: %llu",
2697 (
"file: %s, pos: %llu", file_var ? *file_var :
"<none>",
2698 pos_var ? *pos_var : 0));
2707 (
"file: %s, pos: %llu", file_var ? *file_var :
"<none>",
2708 pos_var ? *pos_var : 0));
2892#if defined(ENABLED_DEBUG_SYNC)
2894 struct st_debug_sync_control *debug_sync_control;
2908 explicit THD(
bool enable_plugins =
true);
2959 enum_thd_life_cycle_stages::ACTIVE};
3045 void disconnect(
bool server_shutdown =
false);
3058 size_t query_len,
bool is_trans,
bool direct,
3059 bool suppress_use,
int errcode);
3065 const char *src_function,
const char *src_file,
3066 int src_line)
override {
3076 enter_stage(stage, old_stage, src_function, src_file, src_line);
3081 const char *src_file,
int src_line)
override {
3093 enter_stage(stage,
nullptr, src_function, src_file, src_line);
3129 bool needs_thr_lock_abort)
override;
3132 bool *victimized)
override;
3261 const char *from,
size_t from_length,
3283 bool is_connected(
bool use_cached_connection_alive =
false) final;
3354 bool copy_conditions =
true) {
3372 template <
typename ProtocolClass>
3393 DBUG_PRINT(
"info", (
"change_item_tree place %p old_value %p new_value %p",
3394 place, *place, new_value));
3424 uint add_state_flags);
3536 return variables.gtid_next_list.is_non_null
3870 auto xid_state = trx->xid_state();
3885 auto xid_state = trx->xid_state();
3889#ifdef HAVE_GTID_NEXT_LIST
3914#ifdef HAVE_GTID_NEXT_LIST
3915 owned_gtid_set.
clear();
3998#ifdef HAVE_PSI_THREAD_INTERFACE
4018 return copy_db_to(
const_cast<char const **
>(p_db), p_db_length);
4138 uint code,
const char *message_text);
4208 size_t query_length_arg [[maybe_unused]]) {
4211 static_cast<uint
>(query_length_arg));
4212#ifdef HAVE_PSI_THREAD_INTERFACE
4215 (query_arg,
static_cast<uint
>(query_length_arg));
4240 void set_query(
const char *query_arg,
size_t query_length_arg) {
4241 const LEX_CSTRING tmp = {query_arg, query_length_arg};
4396 bool some_non_transactional_table,
4397 bool non_transactional_tables_are_tmp);
4481 MY_ATTRIBUTE((format(printf, 2, 3)));
4488 MY_ATTRIBUTE((format(printf, 3, 4)));
4492 MY_ATTRIBUTE((format(printf, 3, 0)));
4493 void vsyntax_error_at(const
char *pos_in_lexer_raw_buffer, const
char *format,
4494 va_list args) MY_ATTRIBUTE((format(printf, 3, 0)));
4825 unsigned long subevent,
bool check_audited);
4864 const char *message =
nullptr);
4927 return thd->
variables.xa_detach_on_prepare;
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
uint32_t Access_bitmask
Definition: auth_acls.h:34
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
int64 query_id_t
Definition: binlog.h:72
API for getting cost estimates for server operations that are not directly related to a table object.
Definition: opt_costmodel.h:54
Stores status of the currently executed statement.
Definition: sql_error.h:269
bool is_error() const
Definition: sql_error.h:366
void reset_diagnostics_area()
Clear this Diagnostics Area.
Definition: sql_error.cc:361
Diagnostics_area * pop_diagnostics_area()
Pop "this" off the Diagnostics Area stack.
Definition: sql_error.cc:643
const Diagnostics_area * stacked_da() const
Returns the Diagnostics Area below the current diagnostics area on the stack.
Definition: sql_error.h:592
void push_diagnostics_area(THD *thd, Diagnostics_area *da, bool copy_conditions)
Push the given Diagnostics Area on top of the stack.
Definition: sql_error.cc:632
List of Discrete_interval objects.
Definition: discrete_interval.h:87
bool append(Discrete_interval *new_interval)
Definition: discrete_interval.h:117
void clear()
Definition: discrete_interval.h:144
Definition: reference_caching_setup.h:109
void refresh_all()
Definition: reference_caching_setup.cc:247
An instance of the global read lock in a connection.
Definition: sql_class.h:833
bool can_acquire_protection() const
Check if this connection can acquire protection against GRL and emit error if otherwise.
Definition: sql_class.h:853
MDL_ticket * m_mdl_blocks_commits_lock
Also in order to acquire the global read lock, the connection must acquire a shared metadata lock in ...
Definition: sql_class.h:877
MDL_ticket * m_mdl_global_shared_lock
In order to acquire the global read lock, the connection must acquire shared metadata lock in GLOBAL ...
Definition: sql_class.h:871
enum_grl_state m_state
Definition: sql_class.h:865
bool is_acquired() const
Definition: sql_class.h:861
Global_read_lock()
Definition: sql_class.h:841
enum_grl_state
Definition: sql_class.h:835
@ GRL_ACQUIRED_AND_BLOCKS_COMMIT
Definition: sql_class.h:838
@ GRL_ACQUIRED
Definition: sql_class.h:837
@ GRL_NONE
Definition: sql_class.h:836
Represents a set of GTIDs.
Definition: rpl_gtid.h:1557
void clear()
Removes all gtids from this Gtid_set.
Definition: rpl_gtid_set.cc:276
Either statement transaction or normal transaction - related thread-specific storage engine data.
Definition: transaction_info.h:414
This class represents the interface for internal error handlers.
Definition: error_handler.h:47
A registry for item tree transformations performed during query optimization.
Definition: sql_class.h:535
bool m_cancel
Definition: sql_class.h:546
Item * old_value
Definition: sql_class.h:544
Item_change_record(Item **place, Item *new_value)
Definition: sql_class.h:541
Item ** place
Definition: sql_class.h:543
Item * new_value
Definition: sql_class.h:545
Item_change_record()=default
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Definition: sql_list.h:494
Tables that were locked with LOCK TABLES statement.
Definition: locked_tables_list.h:89
An interface to separate the MDL module from the THD, and the rest of the server code.
Definition: mdl.h:86
Context of the owner of metadata locks.
Definition: mdl.h:1429
void set_explicit_duration_for_all_locks()
Set explicit duration for all locks in the context.
Definition: mdl.cc:4687
Savepoint for MDL context.
Definition: mdl.h:1318
A granted metadata lock.
Definition: mdl.h:986
Table modification plan for JOIN-less statements (update/delete)
Definition: opt_explain.h:82
Storage for backup of Open_tables_state.
Definition: sql_class.h:693
MDL_savepoint mdl_system_tables_svp
When we backup the open tables state to open a system table or tables, we want to save state of metad...
Definition: sql_class.h:702
Class that holds information about tables which were opened and locked by the thread.
Definition: sql_class.h:557
MYSQL_LOCK * lock
Definition: sql_class.h:625
TABLE * open_tables
List of regular tables in use by this thread.
Definition: sql_class.h:604
MYSQL_LOCK * extra_lock
Definition: sql_class.h:632
Open_tables_state()
This constructor initializes Open_tables_state instance which can only be used as backup storage.
Definition: sql_class.h:679
uint state_flags
Definition: sql_class.h:672
void reset_open_tables_state()
Definition: sql_class.cc:664
Reprepare_observer * pop_reprepare_observer()
Definition: sql_class.h:591
void push_reprepare_observer(Reprepare_observer *o)
Definition: sql_class.h:587
enum_flags
Definition: sql_class.h:664
@ BACKUPS_AVAIL
Definition: sql_class.h:665
@ SYSTEM_TABLES
Definition: sql_class.h:666
enum enum_locked_tables_mode locked_tables_mode
Definition: sql_class.h:662
Reprepare_observer * get_reprepare_observer() const
Definition: sql_class.h:582
TABLE * temporary_tables
List of temporary tables used by this thread.
Definition: sql_class.h:610
void reset_reprepare_observers()
Definition: sql_class.h:597
void set_open_tables_state(Open_tables_state *state)
Definition: sql_class.cc:649
Prealloced_array< Reprepare_observer *, 4 > m_reprepare_observers
A stack of Reprepare_observer-instances.
Definition: sql_class.h:579
A per-session context which is always available at any point of execution, because in practice it's a...
Definition: opt_trace_context.h:94
Profiling state for a single THD; contains multiple QUERY_PROFILE objects.
Definition: sql_profile.h:226
Internal state of the parser.
Definition: sql_lexer_parser_state.h:44
Plugin array helper class.
Definition: sql_plugin_ref.h:110
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
Container for all prepared statements created/used in a connection.
Definition: sql_class.h:483
Prepared_statement_map()
Definition: sql_class.cc:2123
void claim_memory_ownership(bool claim)
Definition: sql_class.cc:2185
Prepared_statement * find_by_name(const LEX_CSTRING &name)
Find prepared statement by name.
Definition: sql_class.cc:2160
int insert(Prepared_statement *statement)
Insert a new statement to the thread-local prepared statement map.
Definition: sql_class.cc:2129
Prepared_statement * m_last_found_statement
Definition: sql_class.h:525
~Prepared_statement_map()
Definition: sql_class.cc:2209
void reset()
Definition: sql_class.cc:2191
void erase(Prepared_statement *statement)
Erase all prepared statements (calls Prepared_statement destructor).
Definition: sql_class.cc:2174
collation_unordered_map< std::string, Prepared_statement * > names_hash
Definition: sql_class.h:524
malloc_unordered_map< ulong, std::unique_ptr< Prepared_statement > > st_hash
Definition: sql_class.h:523
Prepared_statement * find(ulong id)
Find prepared statement by ID.
Definition: sql_class.cc:2165
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:150
Definition: protocol_classic.h:242
Definition: protocol_classic.h:54
Class used for the old (MySQL 4.0 protocol).
Definition: protocol_classic.h:220
Definition: protocol.h:33
Definition: sql_class.h:348
enum_state get_state() const
Definition: sql_class.h:411
bool is_stmt_prepare_or_first_stmt_execute() const
Definition: sql_class.h:416
T * memdup_typed(const T *mem)
Definition: sql_class.h:434
enum_state
Definition: sql_class.h:367
@ STMT_INITIALIZED
Definition: sql_class.h:368
@ STMT_ERROR
Definition: sql_class.h:373
@ STMT_REGULAR_EXECUTION
Definition: sql_class.h:371
@ STMT_PREPARED
Definition: sql_class.h:370
@ STMT_INITIALIZED_FOR_SP
Definition: sql_class.h:369
@ STMT_EXECUTED
Definition: sql_class.h:372
bool is_repreparing
To check whether a reprepare operation is active.
Definition: sql_class.h:359
bool is_stmt_prepare() const
Definition: sql_class.h:412
LEX_CSTRING strmake(LEX_CSTRING str)
Definition: sql_class.h:441
void reset_item_list()
Definition: sql_class.h:406
char * mem_strdup(const char *str)
Definition: sql_class.h:437
void free_items()
Definition: sql_class.cc:2087
Item * m_item_list
Definition: sql_class.h:354
void * alloc(size_t size)
Definition: sql_class.h:422
Query_arena(MEM_ROOT *mem_root_arg, enum enum_state state_arg)
Definition: sql_class.h:393
bool is_regular() const
Definition: sql_class.h:420
void set_query_arena(const Query_arena &set)
Copies memory-managing members from set.
Definition: sql_class.cc:2098
char * strmake(const char *str, size_t size) const
Definition: sql_class.h:438
enum_state state
Definition: sql_class.h:390
void set_item_list(Item *item)
Definition: sql_class.h:407
void add_item(Item *item)
Definition: sql_class.cc:2082
void * mem_calloc(size_t size)
Definition: sql_class.h:423
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:2104
void set_state(enum_state state_arg)
Definition: sql_class.h:410
T * alloc_typed()
Definition: sql_class.h:429
Query_arena()
Definition: sql_class.h:400
Item * item_list() const
Definition: sql_class.h:405
bool is_stmt_prepare_or_first_sp_execute() const
Definition: sql_class.h:413
void * memdup(const void *str, size_t size)
Definition: sql_class.h:447
MEM_ROOT * mem_root
Definition: sql_class.h:357
virtual ~Query_arena()=default
Definition: query_result.h:58
Definition: sql_lex.h:2618
Definition: rpl_rli.h:206
An interface that is used to take an action when the locking module notices that a table version has ...
Definition: sql_prepare.h:80
Common base class for all row-containing log events.
Definition: log_event.h:2785
Definition: rpl_context.h:407
Base class for secondary engine statement context objects.
Definition: sql_class.h:929
virtual bool is_primary_engine_optimal() const
Definition: sql_class.h:939
virtual ~Secondary_engine_statement_context()=default
Destructs the secondary engine statement context object.
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:54
Definition: sys_vars_resource_mgr.h:70
Definition: session_tracker.h:129
Sql_cmd_common_signal represents the common properties of the SIGNAL and RESIGNAL statements.
Definition: sql_signal.h:88
Sql_cmd_resignal represents a RESIGNAL statement.
Definition: sql_signal.h:168
Sql_cmd_signal represents a SIGNAL statement.
Definition: sql_signal.h:148
Representation of a SQL condition.
Definition: sql_error.h:58
enum_severity_level
Enumeration value describing the severity of the condition.
Definition: sql_error.h:63
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
Used to save context when executing a function or trigger.
Definition: sql_class.h:743
ulonglong option_bits
Definition: sql_class.h:745
bool enable_slow_log
Definition: sql_class.h:754
ulong client_capabilities
Definition: sql_class.h:752
ulonglong first_successful_insert_id_in_cur_stmt
Definition: sql_class.h:747
ha_rows examined_row_count
Definition: sql_class.h:751
SAVEPOINT * savepoints
Definition: sql_class.h:755
ulonglong current_found_rows
Definition: sql_class.h:749
ha_rows sent_row_count
Definition: sql_class.h:751
ulonglong previous_found_rows
Definition: sql_class.h:750
enum enum_check_fields check_for_truncated_fields
Definition: sql_class.h:756
Discrete_intervals_list auto_inc_intervals_forced
Definition: sql_class.h:748
ha_rows num_truncated_fields
Definition: sql_class.h:751
uint in_sub_stmt
Definition: sql_class.h:753
ulonglong first_successful_insert_id_in_prev_stmt
Definition: sql_class.h:746
A derived from THD::Attachable_trx class allows updates in the attachable transaction.
Definition: sql_class.h:2127
bool is_read_only() const override
Definition: sql_class.h:2129
Attachable_trx_rw(const Attachable_trx_rw &)
Attachable_trx_rw & operator=(const Attachable_trx_rw &)
Attachable_trx_rw(THD *thd)
Definition: sql_class.cc:580
Class representing read-only attachable transaction, encapsulates knowledge how to backup state of cu...
Definition: sql_class.h:2084
THD * m_thd
THD instance.
Definition: sql_class.h:2095
Transaction_state m_trx_state
Transaction state data.
Definition: sql_class.h:2106
virtual ~Attachable_trx()
Definition: sql_class.cc:536
Attachable_trx * m_prev_attachable_trx
Attachable_trx which was active for the THD before when this transaction was started (NULL in most ca...
Definition: sql_class.h:2103
Attachable_trx(THD *thd, Attachable_trx *prev_trx)
Definition: sql_class.cc:441
virtual bool is_read_only() const
Definition: sql_class.h:2091
enum_reset_lex m_reset_lex
Definition: sql_class.h:2097
Attachable_trx * get_prev_attachable_trx() const
Definition: sql_class.h:2088
Attachable_trx(const Attachable_trx &)
Attachable_trx & operator=(const Attachable_trx &)
Query plan for EXPLAINable commands, should be locked with LOCK_query_plan before using.
Definition: sql_class.h:1409
void set_query_plan(enum_sql_command sql_cmd, LEX *lex_arg, bool ps)
Set query plan.
Definition: sql_class.cc:2752
void assert_plan_is_locked_if_other() const
Asserts that current_thd has locked this plan, if it does not own it.
Definition: sql_class.cc:2747
bool is_single_table_plan() const
Definition: sql_class.cc:3088
THD *const thd
Definition: sql_class.h:1411
Query_plan & operator=(const Query_plan &)
not defined
Query_plan(const Query_plan &)
not defined
bool is_ps_query() const
Definition: sql_class.h:1464
LEX * lex
LEX of topmost statement.
Definition: sql_class.h:1415
bool is_ps
True if query is run in prepared statement.
Definition: sql_class.h:1419
const Modification_plan * modification_plan
Query plan for UPDATE/DELETE/INSERT/REPLACE.
Definition: sql_class.h:1417
Modification_plan const * get_modification_plan() const
Definition: sql_class.h:1460
enum_sql_command get_command() const
Definition: sql_class.h:1452
LEX * get_lex() const
Definition: sql_class.h:1456
Query_plan(THD *thd_arg)
Definition: sql_class.h:1433
enum_sql_command sql_command
Original sql_command;.
Definition: sql_class.h:1413
void set_modification_plan(Modification_plan *plan_arg)
Definition: sql_class.cc:2768
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
bool is_being_disposed() const
Check if THD is being disposed (i.e.
Definition: sql_class.cc:1385
enum_vio_type get_vio_type() const
Definition: sql_class.cc:2000
std::atomic< mysql_cond_t * > current_cond
Pointer to the condition variable the thread owning this THD is currently waiting for.
Definition: sql_class.h:1568
bool has_gtid_consistency_violation
Definition: sql_class.h:3959
std::unique_ptr< Secondary_engine_statement_context > m_secondary_engine_statement_context
Current query's secondary engine statement context.
Definition: sql_class.h:1071
friend void my_message_sql(uint, const char *, myf)
All global error messages are sent here where the first one is stored for the client.
Definition: mysqld.cc:3942
Rpl_thd_context rpl_thd_ctx
Definition: sql_class.h:3904
struct THD_timer_info * timer
Holds active timer object.
Definition: sql_class.h:1879
void notify_hton_post_release_exclusive(const MDL_key *mdl_key) override
Notify interested storage engines that we have just released exclusive lock for the key.
Definition: sql_class.cc:3115
uint fill_variables_recursion_level
Definition: sql_class.h:1666
thd_scheduler scheduler
Definition: sql_class.h:4021
ulonglong first_successful_insert_id_in_prev_stmt_for_binlog
Definition: sql_class.h:2228
mysql_mutex_t LOCK_thd_query
Protects THD::m_query_string.
Definition: sql_class.h:1243
PSI_statement_locker * m_statement_psi
Current statement instrumentation.
Definition: sql_class.h:2503
std::unique_ptr< dd::cache::Dictionary_client > m_dd_client
Definition: sql_class.h:1008
void disconnect(bool server_shutdown=false)
Disconnect the associated communication endpoint.
Definition: sql_class.cc:1690
bool m_is_admin_conn
Definition: sql_class.h:1606
PSI_transaction_locker_state m_transaction_state
Current transaction instrumentation state.
Definition: sql_class.h:2513
PSI_stage_progress * m_stage_progress_psi
Current stage progress instrumentation.
Definition: sql_class.h:2494
std::atomic< bool > m_is_system_user
Flag that indicates if the user of current session has SYSTEM_USER privilege.
Definition: sql_class.h:4732
void cleanup_connection(void)
Definition: sql_class.cc:1221
Gtid owned_gtid
The GTID of the currently owned transaction.
Definition: sql_class.h:3795
sql_digest_state * m_digest
Current statement digest.
Definition: sql_class.h:2496
Diagnostics_area m_query_rewrite_plugin_da
Definition: sql_class.h:4429
void clear_binlog_local_stmt_filter()
Definition: sql_class.h:1864
struct System_status_var * initial_status_var
Definition: sql_class.h:1156
ulonglong first_successful_insert_id_in_cur_stmt
Definition: sql_class.h:2234
void store_globals()
Definition: sql_class.cc:1759
Secondary_engine_optimization m_secondary_engine_optimization
This flag tells if a secondary storage engine can be used to execute a query in this session.
Definition: sql_class.h:4717
void push_lock_usec(ulonglong &top)
Definition: sql_class.h:1634
rpl_event_coordinates binlog_next_event_pos
Definition: sql_class.h:1711
void reset_n_backup_open_tables_state(Open_tables_backup *backup, uint add_state_flags)
Definition: sql_class.cc:2253
void claim_memory_ownership(bool claim)
Claim all the memory used by the THD object.
Definition: sql_class.cc:2994
void inc_status_select_range()
Definition: sql_class.cc:2489
void set_row_count_func(longlong row_count_func)
Definition: sql_class.h:2420
std::unordered_map< unsigned int, void * > external_store_
Definition: sql_class.h:4812
bool is_a_srv_session() const
Definition: sql_class.h:4598
void set_catalog(const LEX_CSTRING &catalog)
Definition: sql_class.h:1475
void clear_binlog_table_maps()
Definition: sql_class.h:1989
void enable_low_level_commit_ordering()
Enables ordering in ha_commit_low.
Definition: sql_class.cc:3073
void unlock_query_plan()
Definition: sql_class.h:1303
void get_trans_pos(const char **file_var, my_off_t *pos_var) const
Definition: sql_class.h:2692
void rpl_detach_engine_ha_data()
When the thread is a binlog or slave applier it detaches the engine ha_data associated with it and me...
Definition: sql_class.cc:3028
uint fill_status_recursion_level
Used by fill_status() to avoid acquiring LOCK_status mutex twice when this function is called recursi...
Definition: sql_class.h:1665
longlong m_row_count_func
Stores the result of ROW_COUNT() function.
Definition: sql_class.h:2415
unsigned long bind_parameter_values_count
the number of elements in parameters
Definition: sql_class.h:4769
bool is_current_stmt_binlog_disabled() const
Determine if binlogging is currently disabled for this session.
Definition: sql_class.cc:3054
PS_PARAM * bind_parameter_values
The parameter value bindings for the current query.
Definition: sql_class.h:4767
static const int OWNED_SIDNO_GTID_SET
Definition: sql_class.h:3796
Discrete_intervals_list auto_inc_intervals_forced
Definition: sql_class.h:2280
void set_psi(PSI_thread *psi)
Save the performance schema thread instrumentation associated with this user session.
Definition: sql_class.h:4039
bool add_external(unsigned int slot, void *data)
Definition: sql_class.cc:3322
void request_persist_gtid_by_se()
Request SE to persist GTID explicitly.
Definition: sql_class.h:3855
void set_query(const char *query_arg, size_t query_length_arg)
Assign a new value to thd->m_query_string.
Definition: sql_class.h:4240
const String normalized_query()
The current query in normalized form.
Definition: sql_class.cc:3093
void reset_query_for_display()
Reset query string to be displayed in PFS.
Definition: sql_class.h:4224
PSI_thread * get_psi() const
Read the performance schema thread instrumentation associated with this user session.
Definition: sql_class.h:4046
void init_cost_model()
Initialize the optimizer cost model.
Definition: sql_class.cc:3791
std::bitset< SE_GTID_MAX > Se_GTID_flagset
Definition: sql_class.h:3821
ulong statement_id_counter
Definition: sql_class.h:2536
void enter_cond(mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line) override
Enter a condition wait.
Definition: sql_class.h:3063
bool is_log_reset() const
Definition: sql_class.h:3849
bool slave_thread
Definition: sql_class.h:2768
bool m_is_fatal_error
Set to true if execution of the current compound statement can not continue.
Definition: sql_class.h:2780
void shutdown_active_vio()
Definition: sql_class.cc:2005
std::unique_ptr< Protocol_binary > protocol_binary
Definition: sql_class.h:1358
bool is_waiting_for_disk_space() const
Returns the current waiting_for_disk_space flag value.
Definition: sql_class.h:4679
uint dbug_sentry
Definition: sql_class.h:1547
ulonglong first_successful_insert_id_in_prev_stmt
Definition: sql_class.h:2221
Diagnostics_area main_da
Definition: sql_class.h:4427
dd::cache::Dictionary_client * dd_client() const
Definition: sql_class.h:1002
enum_binlog_query_type
Definition: sql_class.h:3047
@ ROW_QUERY_TYPE
Definition: sql_class.h:3049
@ QUERY_TYPE_COUNT
Definition: sql_class.h:3054
@ STMT_QUERY_TYPE
Definition: sql_class.h:3052
SSL_handle m_SSL
SSL data attached to this connection.
Definition: sql_class.h:1402
dd::DD_kill_immunizer * kill_immunizer
When operation on DD tables is in progress then THD is set to kill immune mode.
Definition: sql_class.h:2761
LEX_CSTRING m_invoker_host
Definition: sql_class.h:4452
Prealloced_array< unsigned long, 11 > audit_class_mask
Array of bits indicating which audit classes have already been added to the list of audit plugins whi...
Definition: sql_class.h:2890
bool is_applier_thread() const
Definition: sql_class.h:2001
void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
Definition: sql_class.h:4402
void set_new_thread_id()
Assign a value to m_thread_id by calling Global_THD_manager::get_new_thread_id().
Definition: sql_class.cc:1205
XID debug_binlog_xid_last
Definition: sql_class.h:4649
PSI_statement_locker_state m_statement_state
Current statement instrumentation state.
Definition: sql_class.h:2506
bool notify_hton_pre_acquire_exclusive(const MDL_key *mdl_key, bool *victimized) override
Notify/get permission from interested storage engines before acquiring exclusive lock for the key.
Definition: sql_class.cc:3109
const st_plugin_int * m_plugin
Stores the plugin id it is attached to (if any).
Definition: sql_class.h:4627
void pop_diagnostics_area()
Pop the top DA off the Diagnostics Area stack.
Definition: sql_class.h:3360
bool m_binlog_invoker
It will be set TRUE if CURRENT_USER() is called in account management statements or default definer i...
Definition: sql_class.h:4443
MDL_context mdl_context
Definition: sql_class.h:966
void unpin_gtid()
Unpin and free GTID and TSID.
Definition: sql_class.h:3830
mysql_cond_t COND_thr_lock
Condition variable used for waiting by the THR_LOCK.c subsystem.
Definition: sql_class.h:1572
thr_lock_type insert_lock_default
Type of lock to be used for INSERT statement if lock is not specified explicitly.
Definition: sql_class.h:1652
bool running_explain_analyze
Whether we are currently in the execution phase of an EXPLAIN ANALYZE query.
Definition: sql_class.h:2752
void clear_current_query_costs()
Clear the query costs attributes for the current query.
Definition: sql_class.h:1180
bool has_invoker() const
Definition: sql_class.h:4410
std::unique_ptr< Protocol_text > protocol_text
Definition: sql_class.h:1357
void increment_updates_counter()
Definition: sql_class.cc:2709
const char * proc_info_session(THD *invoking_thd) const
Return the m_proc_info, possibly using the string of an older server release, according to @session....
Definition: sql_class.h:1521
collation_unordered_map< std::string, unique_ptr_my_free< Table_ref > > handler_tables_hash
Definition: sql_class.h:1537
enum_tx_isolation tx_isolation
Definition: sql_class.h:2621
bool is_error() const
true if there is an error in the error stack.
Definition: sql_class.h:3305
unsigned char * m_token_array
Current statement digest token array.
Definition: sql_class.h:2498
void set_ssl(Vio *vio)
Definition: sql_class.h:3000
void save_current_query_costs()
Save the current query costs attributes in the thread session status.
Definition: sql_class.h:1195
bool is_cleanup_done()
Definition: sql_class.cc:1273
my_off_t m_trans_end_pos
Definition: sql_class.h:1953
void restore_sub_statement_state(Sub_statement_state *backup)
Definition: sql_class.cc:2366
THD * get_thd() override
Within MDL subsystem this one is only used for DEBUG_SYNC.
Definition: sql_class.h:3109
void leave_locked_tables_mode()
Leave explicit LOCK TABLES or prelocked mode and restore value of transaction sentinel in MDL subsyst...
Definition: sql_class.cc:2583
bool skip_transaction_read_only_check
Definition: sql_class.h:1897
my_thread_id thread_id() const
Definition: sql_class.h:2558
resourcegroups::Resource_group_ctx * resource_group_ctx()
Get resource group context.
Definition: sql_class.h:4029
void set_trans_pos(const char *file, my_off_t pos)
Functions to set and get transaction position.
Definition: sql_class.h:2667
my_thread_t real_id
Definition: sql_class.h:2538
void push_protocol(const std::unique_ptr< ProtocolClass > &protocol)
Definition: sql_class.h:3373
void begin_attachable_rw_transaction()
Start a read-write attachable transaction.
Definition: sql_class.cc:2288
void lock_query_plan()
Locks the query plan of this THD.
Definition: sql_class.h:1302
void nocheck_register_item_tree_change(Item **place, Item *new_value)
Remember that place was updated with new_value so it can be restored by rollback_item_tree_changes().
Definition: sql_class.cc:2045
ha_rows get_examined_row_count() const
Definition: sql_class.h:2466
void get_trans_fixed_pos(const char **file_var, my_off_t *pos_var) const
Definition: sql_class.h:2702
bool copy_db_to(char **p_db, size_t *p_db_length) const
Definition: sql_class.h:4017
void set_security_context(Security_context *sctx)
Definition: sql_class.h:1330
void send_kill_message() const
Definition: sql_class.cc:2217
void inc_status_select_scan()
Definition: sql_class.cc:2505
Event_tracking_data_stack event_tracking_data_
Definition: sql_class.h:4839
void reset_gtid_persisted_by_se()
Reset by SE at transaction end after persisting GTID.
Definition: sql_class.h:3861
bool tx_commit_pending
Definition: sql_class.h:1080
USER_CONN * m_user_connect
Definition: sql_class.h:2446
void swap_rewritten_query(String &query_arg)
Set the rewritten query (with passwords obfuscated etc.) on the THD.
Definition: sql_class.cc:3188
Cost_model_server m_cost_model
Optimizer cost model for server operations.
Definition: sql_class.h:4460
char scramble[SCRAMBLE_LENGTH+1]
Definition: sql_class.h:2764
my_timeval query_start_timeval_trunc(uint decimals)
Definition: sql_class.cc:1039
void inc_status_sort_scan()
Definition: sql_class.cc:2538
PSI_stage_key m_current_stage_key
Definition: sql_class.h:1478
Relay_log_info * rli_slave
Definition: sql_class.h:1077
uint open_options
Definition: sql_class.h:2560
double double_value
Definition: sql_class.h:2840
List< Security_context > m_view_ctx_list
Definition: sql_class.h:1342
bool is_current_stmt_binlog_enabled_and_caches_empty() const
Checks whether binlog caches are disabled (binlog does not cache data) or empty in case binloggging i...
Definition: sql_class.cc:3064
Query_arena * stmt_arena
Definition: sql_class.h:2199
enum_binlog_format current_stmt_binlog_format
Indicates the format in which the current statement will be logged.
Definition: sql_class.h:1911
void reset_query()
Definition: sql_class.h:4245
void clear_clone_vio()
Clear clone network Vio for remote clone.
Definition: sql_class.h:3022
void inc_status_created_tmp_tables()
Definition: sql_class.cc:2460
uint get_rand_seed() const override
Provide thread specific random seed for MDL_context's PRNG.
Definition: sql_class.h:3147
ha_rows m_sent_row_count
Number of rows we actually sent to the client, including "synthetic" rows in ROLLUP etc.
Definition: sql_class.h:2431
std::atomic< PSI_thread * > m_psi
Performance schema thread instrumentation for this session.
Definition: sql_class.h:4056
void raise_error_printf(uint code,...)
Raise an exception condition, with a formatted message.
Definition: sql_class.cc:989
bool m_is_low_level_commit_ordering_enabled
Flag indicating whether additional ordering in the ha_commit_low function is enabled.
Definition: sql_class.h:1597
void set_status_no_index_used()
Definition: sql_class.cc:2546
static const int OWNED_SIDNO_ANONYMOUS
Definition: sql_class.h:3797
bool push_event_tracking_data(Event_tracking_class event, const Event_tracking_information *Event_tracking_information)
Definition: sql_class.cc:3359
Vio * clone_vio
Definition: sql_class.h:2160
bool is_server_upgrade_thread() const
Definition: sql_class.h:2593
void end_statement()
Definition: sql_class.cc:2110
LEX_CSTRING m_query_string
The query associated with this statement.
Definition: sql_class.h:1013
const CHARSET_INFO * collation()
Definition: sql_class.h:3155
bool charset_is_collation_connection
Definition: sql_class.h:2818
LEX_CSTRING m_invoker_user
It points to the invoker in the Query_log_event.
Definition: sql_class.h:4451
bool is_extrenal_xa() const
Definition: sql_class.h:3883
void reset_binlog_local_stmt_filter()
Definition: sql_class.h:1860
mysql_mutex_t LOCK_query_plan
Protects query plan (SELECT/UPDATE/DELETE's) from being freed/changed while another thread explains i...
Definition: sql_class.h:1290
void time_out_user_resource_limits()
Definition: sql_class.cc:2732
void clear_active_vio()
Definition: sql_class.h:3006
const Protocol * get_protocol() const
Definition: sql_class.h:1360
ulonglong m_lock_usec
Time spent waiting for TABLE locks and DATA locks.
Definition: sql_class.h:1629
bool need_binlog_invoker() const
Definition: sql_class.h:4400
bool is_dd_system_thread() const
Definition: sql_class.h:2567
ulong max_client_packet_length
Definition: sql_class.h:1534
int thd_tx_priority
Definition: sql_class.h:2637
LEX_CSTRING m_db
Name of the current (default) database.
Definition: sql_class.h:1034
std::atomic< bool > m_safe_to_display
Definition: sql_class.h:1015
binlog_filter_state get_binlog_local_stmt_filter() const
Definition: sql_class.h:1874
uchar * binlog_row_event_extra_data
Definition: sql_class.h:1720
THR_LOCK_INFO lock_info
Definition: sql_class.h:1229
bool derived_tables_processing
Definition: sql_class.h:2822
void pop_event_tracking_data()
Definition: sql_class.cc:3404
void record_first_successful_insert_id_in_cur_stmt(ulonglong id_arg)
Definition: sql_class.h:2317
unsigned short m_regular_statement_handle_count
Count of Regular Statement Handles in use.
Definition: sql_class.h:4848
long long_value
Definition: sql_class.h:2837
LEX_CSTRING m_catalog
Currently selected catalog.
Definition: sql_class.h:1021
Opt_trace_context opt_trace
optimizer trace of current statement
Definition: sql_class.h:4088
bool in_loadable_function
Definition: sql_class.h:4816
bool send_result_set_row(const mem_root_deque< Item * > &row_items)
Send one result set row.
Definition: sql_class.cc:2941
bool is_system_thread() const
Definition: sql_class.h:2564
void set_admin_connection(bool admin)
Definition: sql_class.h:1609
class THD::Query_plan query_plan
void reset_sub_statement_state(Sub_statement_state *backup, uint new_state)
Definition: sql_class.cc:2323
bool is_a_srv_session_thd
Variable to mark if the object is part of a Srv_session object, which aggregates THD.
Definition: sql_class.h:4624
Thd_mem_cnt m_mem_cnt
Controlled memory stats for this session.
Definition: sql_class.h:957
LEX * lex
Definition: sql_class.h:1001
bool status_var_aggregated
Definition: sql_class.h:1158
ulonglong current_found_rows
Dynamic, collected and set also in subqueries.
Definition: sql_class.h:2358
void increment_questions_counter()
Definition: sql_class.cc:2715
void increment_user_connections_counter()
Definition: sql_class.cc:2690
void set_clone_vio(Vio *vio)
Set active clone network Vio for remote clone.
Definition: sql_class.h:3015
Time_zone * time_zone()
Definition: sql_class.h:3159
void set_system_user(bool system_user_flag)
Sets the system_user flag atomically for the current session.
Definition: sql_class.h:4900
const Diagnostics_area * get_stmt_da() const
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3311
query_id_t query_id
Definition: sql_class.h:2533
void set_safe_display(bool safe)
Set if the query string to be safe to display.
Definition: sql_class.h:4234
ulonglong get_lock_usec()
Definition: sql_class.h:1632
Session_sysvar_resource_manager session_sysvar_res_mgr
Definition: sql_class.h:4477
void send_statement_status()
Definition: sql_class.cc:2958
bool is_connected(bool use_cached_connection_alive=false) final
Return false if connection to client is broken.
Definition: sql_class.cc:3239
const char * thread_stack
Definition: sql_class.h:1311
LEX_CSTRING get_invoker_user() const
Definition: sql_class.h:4408
bool fill_information_schema_tables() const
Definition: sql_class.h:3256
void set_waiting_for_disk_space(bool waiting)
Set the waiting_for_disk_space flag.
Definition: sql_class.h:4673
std::atomic< mysql_mutex_t * > current_mutex
The mutex used with current_cond.
Definition: sql_class.h:1558
void decrement_user_connections_counter()
Definition: sql_class.cc:2696
~THD() override
Definition: sql_class.cc:1484
my_thread_id m_thread_id
This counter is 32 bit because of the client protocol.
Definition: sql_class.h:2550
void set_command(enum enum_server_command command)
Definition: sql_class.cc:2560
bool event_notify(struct st_mysql_event_generic *event_data)
Definition: sql_class.cc:3412
bool is_admin_connection() const
Definition: sql_class.h:1610
Protocol * m_protocol
Definition: sql_class.h:1391
void set_current_stmt_binlog_format_row_if_mixed()
Definition: sql_class.h:3480
String m_normalized_query
Definition: sql_class.h:1014
void init_query_mem_roots()
Initialize memory roots necessary for query processing and (!) pre-allocate memory for it.
Definition: sql_class.cc:1199
void fatal_error()
Mark the current error as fatal.
Definition: sql_class.h:3290
void set_connection_admin(bool connection_admin_flag)
Sets the connection_admin flag atomically for the current session.
Definition: sql_class.h:4919
const LEX_CSTRING & catalog() const
Definition: sql_class.h:1473
void clear_next_event_pos()
Definition: sql_class.cc:2649
void set_server_id(uint32 sid)
Definition: sql_class.h:1756
bool m_secondary_engine_forced
Flag that tells whether secondary storage engine is forced for execution.
Definition: sql_class.h:4725
bool set_db(const LEX_CSTRING &new_db)
Set the current database; use deep copy of C-string.
Definition: sql_class.cc:928
void exit_cond(const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line) override
End a wait on a condition.
Definition: sql_class.h:3080
bool is_engine_ha_data_detached() const
Definition: sql_class.cc:3048
bool is_attachable_ro_transaction_active() const
Definition: sql_class.h:3457
Sql_condition * raise_condition(uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level level, const char *msg, bool fatal_error=false)
Raise a generic SQL condition.
Definition: sql_class.cc:1052
PSI_transaction_locker * m_transaction_psi
Current transaction instrumentation.
Definition: sql_class.h:2510
void set_query_id(query_id_t new_query_id)
Assign a new value to thd->query_id.
Definition: sql_class.h:4293
Session_tracker session_tracker
Definition: sql_class.h:4476
const LEX_CSTRING & query() const
Definition: sql_class.h:4182
bool enable_slow_log
Definition: sql_class.h:2820
Internal_error_handler * pop_internal_handler()
Remove the error handler last pushed.
Definition: sql_class.cc:977
bool audit_plugins_present
Definition: sql_class.h:4840
Event_tracking_data get_event_tracking_data()
Definition: sql_class.h:4819
enum enum_mark_columns mark_used_columns
MARK_COLUMNS_NONE: Means mark_used_columns is not set and no indicator to handler of fields used is s...
Definition: sql_class.h:980
int is_killed() const final
Has the owner thread been killed?
Definition: sql_class.h:3097
struct timeval user_time
Definition: sql_class.h:1618
struct THD_timer_info * timer_cache
After resetting(cancelling) timer, current timer object is cached with timer_cache timer to reuse.
Definition: sql_class.h:1884
bool is_fatal_sub_stmt_error
true if we are in a sub-statement and the current error can not be safely recovered until we left the...
Definition: sql_class.h:2800
bool optimizer_switch_flag(ulonglong flag) const
Tells whether the given optimizer_switch flag is on.
Definition: sql_class.h:1850
Diagnostics_area * m_query_rewrite_plugin_da_ptr
Definition: sql_class.h:4430
void vsyntax_error_at(const POS &location, const char *format, va_list args)
Definition: sql_class.cc:2862
longlong get_row_count_func() const
Definition: sql_class.h:2418
ulong rand_saved_seed2
Definition: sql_class.h:2537
enum THD::Commit_error commit_error
ulonglong previous_found_rows
Stores the result of the FOUND_ROWS() function.
Definition: sql_class.h:2352
int binlog_flush_pending_rows_event(bool stmt_end)
Definition: sql_class.h:1766
void inc_status_sort_rows(ha_rows count)
Definition: sql_class.cc:2529
enum durability_properties durability_property
Definition: sql_class.h:2730
bool waiting_for_disk_space
Definition: sql_class.h:4665
SSL_handle get_ssl() const
Definition: sql_class.h:1364
bool m_audited
Definition: sql_class.h:2906
void clear_current_stmt_binlog_format_row()
Definition: sql_class.h:3509
void set_user_connect(USER_CONN *uc)
Definition: sql_class.cc:2684
enum enum_server_command get_command() const
Definition: sql_class.h:4160
bool is_regular() const =delete
double m_current_query_cost
Current query cost.
Definition: sql_class.h:1169
bool might_have_commit_order_waiters() const final
Indicates that owner thread might have some commit order (non-MDL) waits for it which are still taken...
Definition: sql_class.h:3098
Discrete_intervals_list auto_inc_intervals_in_cur_stmt_for_binlog
Definition: sql_class.h:2278
bool tx_read_only
Definition: sql_class.h:2626
void syntax_error_at(const POS &location)
Definition: sql_class.h:4484
Prealloced_array< Ha_data, PREALLOC_NUM_HA > ha_data
Definition: sql_class.h:1670
const CHARSET_INFO * db_charset
Definition: sql_class.h:2488
int is_current_stmt_binlog_format_row() const
Determine the binlog format of the current statement.
Definition: sql_class.h:1780
const Gtid_set * get_gtid_next_list_const() const
Return the value of @gtid_next_list: either a Gtid_set or NULL.
Definition: sql_class.h:3542
void set_next_event_pos(const char *_filename, ulonglong _pos)
Definition: sql_class.cc:2633
bool is_mem_cnt_error()
Definition: sql_class.h:4799
void set_plugin(const st_plugin_int *plugin)
Sets the plugin id to the value provided as parameter.
Definition: sql_class.h:4610
const Protocol_classic * get_protocol_classic() const
Asserts that the protocol is of type text or binary and then returns the m_protocol casted to Protoco...
Definition: sql_class.h:1383
String packet
Definition: sql_class.h:1958
void set_tmp_table_seq_id(uint arg)
Definition: sql_class.h:4613
bool stmt_depends_on_first_successful_insert_id_in_prev_stmt
Definition: sql_class.h:2263
void push_internal_handler(Internal_error_handler *handler)
Add an internal error handler to the thread execution context.
Definition: sql_class.cc:956
void copy_status_var(System_status_var *dst_var)
Copy status variables into a structure pointed by the specified pointer and keep track of the pointer...
Definition: sql_class.h:1213
bool is_operating_gtid_table_implicitly
Definition: sql_class.h:2366
void syntax_error()
Definition: sql_class.h:4479
bool handle_condition(uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *level, const char *msg)
Handle a sql condition.
Definition: sql_class.cc:964
Event_reference_caching_cache * events_cache_
Definition: sql_class.h:4838
void set_current_stmt_binlog_format_row()
Definition: sql_class.h:3504
Prepared_statement_map stmt_map
All prepared statements of this connection.
Definition: sql_class.h:1306
uint server_status
Definition: sql_class.h:2560
friend void push_warning(THD *thd, Sql_condition::enum_severity_level severity, uint code, const char *message_text)
Push the warning to error list if there is still room in the list.
Definition: sql_error.cc:659
void set_secondary_engine_statement_context(std::unique_ptr< Secondary_engine_statement_context > context)
Definition: sql_class.cc:923
bool bool_value
Definition: sql_class.h:2836
bool is_killable
Definition: sql_class.h:1549
void set_query_for_display(const char *query_arg, size_t query_length_arg)
Set query to be displayed in performance schema (threads table etc.).
Definition: sql_class.h:4207
bool is_system_user()
Returns if the user of the session has the SYSTEM_USER privilege or not.
Definition: sql_class.h:4891
bool is_current_stmt_binlog_log_replica_updates_disabled() const
Determine if binlogging is currently disabled for this session.
Definition: sql_class.cc:3059
void debug_assert_query_locked() const
For safe and protected access to the query string, the following rules should be followed: 1: Only th...
Definition: sql_class.cc:2567
void force_one_auto_inc_interval(ulonglong next_id)
Definition: sql_class.h:2343
uint64_t sql_mode_t
Definition: sql_lexer_thd.h:38
sp_rcontext * sp_runtime_ctx
Current SP-runtime context.
Definition: sql_class.h:2827
void inc_examined_row_count(ha_rows count)
Definition: sql_class.cc:2447
bool is_strict_mode() const
Definition: sql_class.h:3151
bool skip_gtid_rollback
Definition: sql_class.h:3942
Parser_state * m_parser_state
Internal parser state.
Definition: sql_lexer_thd.h:66
void update_charset()
Definition: sql_class.cc:1950
void inc_status_select_full_join()
Definition: sql_class.cc:2473
List< char > * get_binlog_accessed_db_names() const
Definition: sql_class.h:1994
void pop_protocol()
Pops the top protocol of the Protocol stack and sets the previous one as the current protocol.
Definition: sql_class.cc:3282
void enable_mem_cnt()
Definition: sql_class.h:4792
bool m_inside_system_variable_global_update
Flag to indicate this thread is executing sys_var::update for a OPT_GLOBAL variable.
Definition: sql_class.h:4762
bool is_current_stmt_binlog_row_enabled_with_write_set_extraction() const
Determine if binloging is enabled in row format and write set extraction is enabled for this session.
Definition: sql_class.cc:3068
void set_binlog_local_stmt_filter()
Definition: sql_class.h:1869
bool is_cmd_skip_readonly() const
Definition: sql_class.h:1971
thr_lock_type update_lock_default
Type of lock to be used for all DML statements, except INSERT, in cases when lock is not specified ex...
Definition: sql_class.h:1646
enum enum_thread_type system_thread
Definition: sql_class.h:2561
void clear_copy_status_var()
Clear copy of the status variables.
Definition: sql_class.h:1204
void raise_note_printf(uint code,...)
Raise an completion condition (note), with a formatted message.
Definition: sql_class.cc:1026
bool is_mem_cnt_error_issued
Definition: sql_class.h:4798
void reset_skip_transaction_read_only_check()
Definition: sql_class.h:1981
const char * current_key_name
Definition: sql_class.h:4796
ha_rows num_truncated_fields
Definition: sql_class.h:2424
partition_info * work_part_info
Definition: sql_class.h:2878
bool has_incremented_gtid_automatic_count
Flag indicating whether this session incremented the number of sessions with GTID_NEXT set to AUTOMAT...
Definition: sql_class.h:4845
void * fetch_external(unsigned int slot)
Definition: sql_class.cc:3330
bool is_attachable_transaction_active() const
Definition: sql_class.h:3464
enum_thd_life_cycle_stages
Represents life cycle stages of THD instance.
Definition: sql_class.h:2950
@ ACTIVE_AND_CLEAN
Definition: sql_class.h:2952
@ SCHEDULED_FOR_DISPOSAL
Definition: sql_class.h:2953
@ RESOURCES_RELEASED
Definition: sql_class.h:2955
@ DISPOSED
Definition: sql_class.h:2956
@ ACTIVE
Definition: sql_class.h:2951
@ CLEANED_UP
Definition: sql_class.h:2954
System_variables variables
Definition: sql_lexer_thd.h:64
void set_log_reset()
Set when binlog reset operation is started.
Definition: sql_class.h:3843
struct rand_struct rand
Definition: sql_class.h:1150
bool is_slave_error
True if a slave error.
Definition: sql_class.h:2810
List< char > * binlog_accessed_db_names
Definition: sql_class.h:1935
void set_original_commit_timestamp_for_slave_thread()
Copies variables.original_commit_timestamp to ((Slave_worker *)rli_slave)->original_commit_timestamp,...
Definition: sql_class.cc:2657
bool is_stmt_prepare_or_first_stmt_execute() const =delete
binlog_filter_state
Definition: sql_class.h:1854
@ BINLOG_FILTER_CLEAR
Definition: sql_class.h:1856
@ BINLOG_FILTER_UNKNOWN
Definition: sql_class.h:1855
@ BINLOG_FILTER_SET
Definition: sql_class.h:1857
bool is_init_file_system_thread() const
Definition: sql_class.h:2580
void set_secondary_engine_forced(bool forced)
Indicate whether secondary storage engine is forced for this execution.
Definition: sql_class.h:4706
ha_rows m_examined_row_count
Number of rows read and/or evaluated for a statement.
Definition: sql_class.h:2443
bool query_start_usec_used
Definition: sql_class.h:2801
time_t query_start_in_secs() const
Definition: sql_class.h:3163
THD * next_to_commit
Used by MYSQL_BIN_LOG to maintain the commit queue for binary log group commit.
Definition: sql_class.h:2649
void set_transaction(Transaction_ctx *transaction_ctx)
Changes the Transaction_ctx instance within THD-object.
Definition: sql_class.cc:916
enum_thd_life_cycle_stages m_thd_life_cycle_stage
Definition: sql_class.h:2958
mysql_mutex_t LOCK_group_replication_connection_mutex
Definition: sql_class.h:4789
void raise_warning_printf(uint code,...)
Raise a completion condition (warning), with a formatted message.
Definition: sql_class.cc:1006
bool is_classic_protocol() const
Definition: sql_class.cc:3234
Prealloced_array< Binlog_user_var_event *, 2 > user_var_events
Definition: sql_class.h:2642
PSI_stage_key get_current_stage_key() const
Definition: sql_class.h:1525
bool send_result_metadata(const mem_root_deque< Item * > &list, uint flags)
Send name and type of result to client.
Definition: sql_class.cc:2902
bool is_stmt_prepare_or_first_sp_execute() const =delete
mysql_mutex_t LOCK_thd_protocol
Protects THD::m_protocol when it gets removed in x plugin.
Definition: sql_class.h:1258
bool parsing_system_view
Definition: sql_class.h:2824
Diagnostics_area * m_stmt_da
Definition: sql_class.h:4432
bool is_binlog_applier() const
The function checks whether the thread is processing queries from binlog, as automatically generated ...
Definition: sql_class.h:1088
bool skip_readonly_check
Definition: sql_class.h:1891
const String & rewritten_query() const
Get the rewritten query (with passwords obfuscated etc.) from the THD.
Definition: sql_class.h:4272
void cleanup(void)
Definition: sql_class.cc:1283
void set_is_killable(bool is_killable_arg)
Assign a new value to is_killable Protected with the LOCK_thd_data mutex.
Definition: sql_class.h:4314
void inc_status_created_tmp_disk_tables()
Definition: sql_class.cc:2452
const Transaction_ctx * get_transaction() const
Definition: sql_class.h:2142
bool is_connection_admin()
Returns if the user of the session has the CONNECTION_ADMIN privilege or not.
Definition: sql_class.h:4910
mysql::gtid::Tsid owned_tsid
For convenience, this contains the TSID component of the GTID stored in owned_gtid.
Definition: sql_class.h:3803
struct timeval start_time
Definition: sql_class.h:1617
binlog_filter_state m_binlog_filter_state
Indicate if the current statement should be discarded instead of written to the binlog.
Definition: sql_class.h:1905
const CHARSET_INFO * charset() const
Definition: sql_class.h:3384
void init(void)
Definition: sql_class.cc:1117
void copy_table_access_properties(THD *thd)
Copy session properties that affect table access from the parent session to the current session.
Definition: sql_class.cc:909
bool is_secondary_storage_engine_eligible() const
Checks if queries in this session can use a secondary storage engine for execution.
Definition: sql_class.cc:3164
void set_status_no_good_index_used()
Definition: sql_class.cc:2553
std::unique_ptr< LEX > main_lex
The lex to hold the parsed tree of conventional (non-prepared) queries.
Definition: sql_class.h:998
const char * where
Definition: sql_class.h:1532
LEX_CSTRING get_invoker_host() const
Definition: sql_class.h:4409
ha_rows get_sent_row_count() const
Definition: sql_class.h:2464
bool charset_is_character_set_filesystem
Definition: sql_class.h:2819
void reset_copy_status_var()
Copy status variables into a structure pointed by the specified pointer passed into copy_status_var m...
Definition: sql_class.h:1222
bool safe_to_display() const
Definition: sql_class.h:4230
void reset_first_successful_insert_id()
Definition: sql_class.h:2330
void set_time()
Definition: sql_class.cc:3289
bool is_fsp_truncate_mode() const
Definition: sql_class.h:3170
Access_bitmask want_privilege
Used by Item::check_column_privileges() to tell which privileges to check for.
Definition: sql_class.h:989
uint32 file_id
Definition: sql_class.h:1614
Internal_error_handler * m_internal_handler
The current internal error handler for this thread, or NULL.
Definition: sql_class.h:4416
void push_diagnostics_area(Diagnostics_area *da, bool copy_conditions=true)
Push the given Diagnostics Area on top of the stack, making it the new first Diagnostics Area.
Definition: sql_class.h:3353
void disable_low_level_commit_ordering()
Enables ordering in ha_commit_low.
Definition: sql_class.cc:3078
Plugin_array audit_class_plugins
Array of active audit plugins which have been used by this THD.
Definition: sql_class.h:2885
const NET * get_net() const
Definition: sql_class.h:1960
bool transaction_rollback_request
Set by a storage engine to request the entire transaction (that possibly spans multiple engines) to r...
Definition: sql_class.h:2788
void set_active_vio(Vio *vio)
Definition: sql_class.h:2994
void release_external_store()
Definition: sql_class.cc:3702
uint16 peer_port
Definition: sql_class.h:1616
Secondary_engine_optimization secondary_engine_optimization() const
Can secondary storage engines be used for query execution in this session?
Definition: sql_class.h:4692
bool binlog_need_explicit_defaults_ts
The member is served for marking a query that CREATEs or ALTERs a table declared with a TIMESTAMP col...
Definition: sql_class.h:2658
void set_skip_transaction_read_only_check()
Definition: sql_class.h:1968
uint in_sub_stmt
Definition: sql_class.h:1655
void inc_lock_usec(ulonglong usec)
Definition: sql_class.cc:3302
void disable_mem_cnt()
Definition: sql_class.h:4793
void rollback_item_tree_changes()
Restore locations set by calls to nocheck_register_item_tree_change().
Definition: sql_class.cc:2065
bool se_persists_gtid() const
Definition: sql_class.h:3867
char * m_trans_fixed_log_file
Definition: sql_class.h:1952
bool is_low_level_commit_ordering_enabled() const
Obtains flag indicating whether additional ordering in the ha_commit_low function is enabled.
Definition: sql_class.cc:3083
bool unioned_events_trans
Definition: sql_class.h:2860
char * strmake(const char *str, size_t size) const
Definition: sql_lexer_thd.h:52
Secondary_engine_statement_context * secondary_engine_statement_context()
Definition: sql_class.h:1106
bool copy_db_to(char const **p_db, size_t *p_db_length) const
Definition: sql_class.h:4007
union THD::@177 sys_var_tmp
void increment_con_per_hour_counter()
Definition: sql_class.cc:2703
std::atomic< bool > m_cached_is_connection_alive
Keep a cached value saying whether the connection is alive.
Definition: sql_class.h:1298
uint get_tmp_table_seq_id()
Definition: sql_class.h:4612
const Diagnostics_area * get_stacked_da() const
Returns the second Diagnostics Area for the current statement.
Definition: sql_class.h:3314
void mark_transaction_to_rollback(bool all)
Mark transaction to rollback and mark error as fatal to a sub-statement.
Definition: sql_class.cc:2623
Attachable_trx * m_attachable_trx
Definition: sql_class.h:2137
void raise_warning(uint code)
Raise a completion condition (warning).
Definition: sql_class.cc:1001
enum_check_fields check_for_truncated_fields
Definition: sql_class.h:2639
uint get_binlog_table_maps() const
Definition: sql_class.h:1988
PSI_idle_locker * m_idle_psi
Idle instrumentation.
Definition: sql_class.h:2517
Diagnostics_area * get_parser_da()
Returns thread-local Diagnostics Area for parsing.
Definition: sql_class.h:3327
void set_time(const struct timeval *t)
Definition: sql_class.h:3166
collation_unordered_map< std::string, unique_ptr_with_deleter< user_var_entry > > user_vars
Hash for user variables.
Definition: sql_class.h:1149
bool sql_parser()
Call parser to transform statement into a parse tree.
Definition: sql_class.cc:3124
bool rand_used
Definition: sql_class.h:2802
NET net
Definition: sql_class.h:1957
ulonglong m_current_query_partial_plans
Current query partial plans.
Definition: sql_class.h:1175
sp_cache * sp_func_cache
Definition: sql_class.h:2829
Cost_model_server m_cost_model_hypergraph
Definition: sql_class.h:4461
int tx_priority
Definition: sql_class.h:2632
std::unique_ptr< Transaction_ctx > m_transaction
Definition: sql_class.h:2007
table_map table_map_for_update
Definition: sql_class.h:2205
void cleanup_after_parse_error()
Restore session state in case of parse error.
Definition: sql_class.cc:3210
mysql_mutex_t LOCK_thd_sysvar
Protects THD::variables while being updated.
Definition: sql_class.h:1249
ulong ulong_value
Definition: sql_class.h:2838
void update_previous_found_rows()
Definition: sql_class.h:3188
void raise_note(uint code)
Raise a completion condition (note), with a fixed message.
Definition: sql_class.cc:1018
void awake(THD::killed_state state_to_set)
Awake a thread.
Definition: sql_class.cc:1562
void change_item_tree(Item **place, Item *new_value)
Record a transient change to a pointer to an Item within another Item.
Definition: sql_class.h:3390
void mark_plugin_fake_ddl(bool flag)
Definition: sql_class.h:4617
mysql_mutex_t LOCK_thd_data
Protects THD data accessed from other threads.
Definition: sql_class.h:1237
bool convert_string(LEX_STRING *to, const CHARSET_INFO *to_cs, const char *from, size_t from_length, const CHARSET_INFO *from_cs, bool report_error=false)
void cleanup_after_query()
Definition: sql_class.cc:1820
void restore_globals()
Definition: sql_class.cc:1790
void inc_status_sort_range()
Definition: sql_class.cc:2521
query_id_t first_query_id
Definition: sql_class.h:2866
Ha_data * get_ha_data(int slot)
Retrieve Ha_data for a given slot.
Definition: sql_class.h:1676
Vio * active_vio
Definition: sql_class.h:2157
uint tmp_table_seq_id
Sequential number of internal tmp table created in the statement.
Definition: sql_class.h:4642
MEM_ROOT * user_var_events_alloc
Definition: sql_class.h:2643
THD(bool enable_plugins=true)
Definition: sql_class.cc:674
uint32 unmasked_server_id
Definition: sql_class.h:1612
const char * m_proc_info
Definition: sql_class.h:1492
void push_protocol(Protocol *protocol)
Inserts the new protocol at the top of the protocol stack, and make it the current protocol for this ...
Definition: sql_class.cc:3274
void end_attachable_transaction()
End an active attachable transaction.
Definition: sql_class.cc:2280
bool is_secondary_engine_forced() const
Definition: sql_class.h:4710
const char * proc_info() const
Definition: sql_class.h:1510
bool is_attachable_rw_transaction_active() const
Definition: sql_class.h:3471
void clear_log_reset()
Cleared after flushing SE logs during binlog reset.
Definition: sql_class.h:3846
const st_plugin_int * get_plugin() const
Returns the plugin, the thd belongs to.
Definition: sql_class.h:4605
enum enum_server_command m_command
Type of current query: COM_STMT_PREPARE, COM_QUERY, etc.
Definition: sql_class.h:1603
void reset_db(const LEX_CSTRING &new_db)
Set the current database; use shallow copy of C-string.
Definition: sql_class.h:3995
Se_GTID_flagset m_se_gtid_flags
Flags for SE GTID persistence.
Definition: sql_class.h:3824
Gtid_set * get_gtid_next_list()
Return the value of @gtid_next_list: either a Gtid_set or NULL.
Definition: sql_class.h:3535
mysql_mutex_t LOCK_current_cond
Mutex protecting access to current_mutex and current_cond.
Definition: sql_class.h:1553
void set_secondary_engine_optimization(Secondary_engine_optimization state)
Enables or disables use of secondary storage engines in this session.
Definition: sql_class.h:4684
Transaction_ctx * get_transaction()
Definition: sql_class.h:2140
bool is_initialize_system_thread() const
Definition: sql_class.h:2575
ulong rand_saved_seed1
Definition: sql_class.h:2537
sp_cache * sp_proc_cache
Definition: sql_class.h:2828
Item_change_list change_list
This is used to track transient changes to items during optimization of a prepared statement/stored p...
Definition: sql_class.h:2185
bool in_active_multi_stmt_transaction() const
true if the session is in a multi-statement transaction mode (
Definition: sql_class.h:3253
void refresh_reference_caches()
Definition: sql_class.h:4827
bool check_clone_vio()
Check if clone network Vio is active.
Definition: sql_class.h:3029
std::unique_ptr< PROFILING > profiling
Definition: sql_class.h:2490
void reset_current_stmt_binlog_format_row()
Definition: sql_class.h:3514
bool m_disable_password_validation
Definition: sql_class.h:1355
bool in_multi_stmt_transaction_mode() const
Returns true if session is in a multi-statement transaction mode.
Definition: sql_class.h:3215
void begin_attachable_ro_transaction()
Start a read-only attachable transaction.
Definition: sql_class.cc:2276
bool do_union
Definition: sql_class.h:2849
const LEX_CSTRING & db() const
Definition: sql_class.h:3961
const Internal_error_handler * get_internal_handler() const
Definition: sql_class.h:4059
ulonglong read_first_successful_insert_id_in_prev_stmt(void)
Definition: sql_class.h:2321
struct THD::@178 binlog_evt_union
uint32 binlog_unsafe_warning_flags
Bit field for the state of binlog warnings.
Definition: sql_class.h:1925
void raise_error(uint code)
Raise an exception condition.
Definition: sql_class.cc:984
std::atomic< killed_state > killed
Definition: sql_class.h:2745
ulonglong start_utime
Query start time, expressed in microseconds.
Definition: sql_class.h:1622
Security_context * m_security_ctx
Definition: sql_class.h:1327
bool is_stmt_prepare() const =delete
void restore_ha_data(const Prealloced_array< Ha_data, PREALLOC_NUM_HA > &backup)
Restore ha_data from the provided backup copy.
Definition: sql_class.h:1695
bool unioned_events
Definition: sql_class.h:2854
bool m_is_plugin_fake_ddl
Creating or dropping plugin native table through a plugin service.
Definition: sql_class.h:4635
void set_sent_row_count(ha_rows count)
Definition: sql_class.cc:2437
uint query_name_consts
number of name_const() substitutions, see sp_head.cc:subst_spvars()
Definition: sql_class.h:2832
NET_SERVER m_net_server_extension
Additional network instrumentation for the server only.
Definition: sql_class.h:1140
void inc_status_count_hit_tmp_table_size()
Definition: sql_class.cc:2468
ulonglong conn_mem_alloc_number
Definition: sql_class.h:4797
String m_rewritten_query
In some cases, we may want to modify the query (i.e.
Definition: sql_class.h:1065
bool m_server_idle
True if the server code is IDLE for this connection.
Definition: sql_class.h:2523
Relay_log_info * rli_fake
Definition: sql_class.h:1075
mysql_mutex_t LOCK_thd_security_ctx
Protects THD::m_security_ctx from inspection (e.g.
Definition: sql_class.h:1264
void backup_ha_data(Prealloced_array< Ha_data, PREALLOC_NUM_HA > *backup)
Copy ha_data into the provided argument.
Definition: sql_class.h:1681
uint32 server_id
Definition: sql_class.h:1613
bool is_fatal_error() const
Definition: sql_class.h:3291
Transactional_ddl_context m_transactional_ddl
Definition: sql_class.h:4747
bool duplicate_slave_id
This is only used by master dump threads.
Definition: sql_class.h:4589
bool charset_is_system_charset
is set if a statement accesses a temporary table created through CREATE TEMPORARY TABLE.
Definition: sql_class.h:2818
void reset_rewritten_query()
Reset thd->m_rewritten_query.
Definition: sql_class.h:4282
void release_resources()
Release most resources, prior to THD destruction.
Definition: sql_class.cc:1406
Security_context * security_context() const
Definition: sql_class.h:1329
bool check_event_subscribers(Event_tracking_class event, unsigned long subevent, bool check_audited)
Definition: sql_class.cc:3334
void restore_backup_open_tables_state(Open_tables_backup *backup)
Definition: sql_class.cc:2262
void pop_lock_usec(ulonglong top)
Definition: sql_class.h:1638
void enter_locked_tables_mode(enum_locked_tables_mode mode_arg)
Definition: sql_class.h:4320
bool time_zone_used
Definition: sql_class.h:2802
ulonglong ulonglong_value
Definition: sql_class.h:2839
void enter_stage(const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *calling_func, const char *calling_file, const unsigned int calling_line) SUPPRESS_TSAN
Definition: sql_class.cc:587
uint binlog_table_maps
Definition: sql_class.h:1931
void inc_status_select_range_check()
Definition: sql_class.cc:2497
int send_explain_fields(Query_result *result)
Definition: sql_class.cc:1962
void clear_error()
Clear the current error, if any.
Definition: sql_class.h:3273
bool is_bootstrap_system_thread() const
Definition: sql_class.h:2586
void binlog_invoker()
Definition: sql_class.h:4399
bool is_one_phase_commit()
Definition: sql_class.cc:3154
void set_gtid_persisted_by_se()
Set by SE when it guarantees GTID persistence.
Definition: sql_class.h:3852
void inc_status_sort_merge_passes()
Definition: sql_class.cc:2513
void mark_as_srv_session()
Definition: sql_class.h:4599
MEM_ROOT main_mem_root
This memory root is used for two purposes:
Definition: sql_class.h:4426
struct System_status_var status_var
Definition: sql_class.h:1152
bool m_enable_plugins
Definition: sql_class.h:2898
struct System_status_var * copy_status_var_ptr
Definition: sql_class.h:1153
void clear_owned_gtids()
Definition: sql_class.h:3906
killed_state
Definition: sql_class.h:2738
@ KILL_QUERY
Definition: sql_class.h:2741
@ KILL_CONNECTION
Definition: sql_class.h:2740
@ KILLED_NO_VALUE
Definition: sql_class.h:2743
@ KILL_TIMEOUT
Definition: sql_class.h:2742
@ NOT_KILLED
Definition: sql_class.h:2739
std::vector< char > m_connection_attributes
Session's connection attributes for the connected client.
Definition: sql_class.h:1163
Locked_tables_list locked_tables_list
Definition: sql_class.h:2876
void get_definer(LEX_USER *definer)
Definition: sql_class.cc:2606
const char * m_trans_log_file
The binary log position of the transaction.
Definition: sql_class.h:1951
bool is_commit_in_middle_of_statement
Definition: sql_class.h:3953
Diagnostics_area * get_stmt_da()
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3308
mysql_cond_t COND_group_replication_connection_cond_var
Definition: sql_class.h:4790
std::atomic< bool > m_is_connection_admin
Flag that indicates if the user of current session has CONNECTION_ADMIN privilege.
Definition: sql_class.h:4737
void inc_status_select_full_range_join()
Definition: sql_class.cc:2481
Diagnostics_area m_parser_da
cf.
Definition: sql_class.h:4428
void notify_shared_lock(MDL_context_owner *ctx_in_use, bool needs_thr_lock_abort) override
A callback to the server internals that is used to address special cases of the locking protocol.
Definition: sql_class.cc:1732
const USER_CONN * get_user_connect() const
Definition: sql_class.h:2450
void shutdown_clone_vio()
Shutdown clone vio, if active.
Definition: sql_class.cc:2023
void pin_gtid()
Defer freeing owned GTID and TSID till unpinned.
Definition: sql_class.h:3827
PSI_idle_locker_state m_idle_state
Idle instrumentation state.
Definition: sql_class.h:2520
bool is_plugin_fake_ddl() const
Definition: sql_class.h:4616
bool arg_of_last_insert_id_function
Definition: sql_class.h:2208
void set_skip_readonly_check()
Definition: sql_class.h:1962
Se_GTID_flag
SE GTID persistence flag types.
Definition: sql_class.h:3806
@ SE_GTID_PERSIST_EXPLICIT
Explicit request for SE to persist GTID for current transaction.
Definition: sql_class.h:3816
@ SE_GTID_RESET_LOG
If RESET log in progress.
Definition: sql_class.h:3814
@ SE_GTID_CLEANUP
Cleanup GTID during unpin.
Definition: sql_class.h:3810
@ SE_GTID_PERSIST
SE would persist GTID for current transaction.
Definition: sql_class.h:3812
@ SE_GTID_MAX
Max element holding the biset size.
Definition: sql_class.h:3818
@ SE_GTID_PIN
Pin owned GTID.
Definition: sql_class.h:3808
bool se_persists_gtid_explicit() const
Definition: sql_class.h:3877
bool for_debug_only_is_set_persist_options
Definition: sql_class.h:1252
void rpl_reattach_engine_ha_data()
When the thread is a binlog or slave applier it reattaches the engine ha_data associated with it and ...
Definition: sql_class.cc:3038
bool release_resources_done() const
Definition: sql_class.cc:1380
bool is_operating_substatement_implicitly
Definition: sql_class.h:2383
void update_slow_query_status()
Evaluate the current time, and if it exceeds the long-query-time setting, mark the query as slow.
Definition: sql_class.cc:3317
uint tmp_table
Definition: sql_class.h:2559
Commit_error
Definition: sql_class.h:2717
@ CE_NONE
Definition: sql_class.h:2718
@ CE_COMMIT_ERROR
Definition: sql_class.h:2722
@ CE_ERROR_COUNT
Definition: sql_class.h:2723
@ CE_SYNC_ERROR
Definition: sql_class.h:2721
@ CE_FLUSH_ERROR
Definition: sql_class.h:2719
@ CE_FLUSH_GNO_EXHAUSTED_ERROR
Definition: sql_class.h:2720
Security_context m_main_security_ctx
Definition: sql_class.h:1326
malloc_unordered_map< std::string, User_level_lock * > ull_hash
Definition: sql_class.h:1544
static const char *const DEFAULT_WHERE
Definition: sql_class.h:1137
void reset_skip_readonly_check()
Definition: sql_class.h:1976
Global_read_lock global_read_lock
Definition: sql_class.h:2155
void inc_sent_row_count(ha_rows count)
Definition: sql_class.cc:2442
bool thread_specific_used
is set if some thread specific value(s) used in a statement.
Definition: sql_class.h:2813
void set_open_tables(TABLE *open_tables_arg)
Assign a new value to open_tables.
Definition: sql_class.h:4304
bool is_cmd_skip_transaction_read_only() const
Definition: sql_class.h:1973
bool owned_gtid_is_empty()
Definition: sql_class.h:3926
resourcegroups::Resource_group_ctx m_resource_group_ctx
Resource group context indicating the current resource group and the name of the resource group to sw...
Definition: sql_class.h:1041
enum_reset_lex
Definition: sql_class.h:2074
@ DO_NOT_RESET_LEX
Definition: sql_class.h:2074
@ RESET_LEX
Definition: sql_class.h:2074
uchar password
Definition: sql_class.h:2770
const Cost_model_server * cost_model() const
Retrieve the optimizer cost model for this connection.
Definition: sql_class.cc:3796
void set_proc_info(const char *proc_info)
Definition: sql_class.h:1524
void start_disposal()
Set THD in ACTIVE life stage to disposal stage.
Definition: sql_class.cc:1393
Diagnostics_area * get_query_rewrite_plugin_da()
Returns thread-local Diagnostics Area to be used by query rewrite plugins.
Definition: sql_class.h:3338
bool in_lock_tables
Definition: sql_class.h:2803
sql_digest_state m_digest_state
Top level statement digest.
Definition: sql_class.h:2500
ulonglong found_rows() const
Definition: sql_class.h:3180
Definition: sql_class.h:252
void restore_mode()
Restore original memory counter mode.
Definition: sql_class.h:284
void no_error_mode()
Set NO ERROR memory counter mode.
Definition: sql_class.h:288
ulonglong glob_mem_counter
Definition: sql_class.h:259
void set_orig_mode(uint mode_arg)
Function sets original memory counter mode.
Definition: sql_class.h:302
void set_curr_mode(uint mode_arg)
Function sets current memory counter mode.
Definition: sql_class.h:296
void flush()
Function flushes memory counters before deleting the memory counter object.
Definition: sql_class.cc:334
void free_cnt(size_t size)
Decrease memory counter at 'free' operation.
Definition: sql_class.cc:259
bool is_error() const
Check if memory counter error is issued.
Definition: sql_class.h:308
ulonglong mem_counter
Definition: sql_class.h:257
void set_thd_error_status() const
Set THD error status using memory counter diagnostics area.
Definition: sql_class.cc:399
THD * m_thd
Definition: sql_class.h:255
int reset()
Function resets current memory counter mode and adjusts global memory counter according to thread mem...
Definition: sql_class.cc:274
Diagnostics_area m_da
Definition: sql_class.h:256
bool is_error_mode() const
Check if memory counter is in error mode.
Definition: sql_class.h:318
~Thd_mem_cnt()
Definition: sql_class.h:269
ulonglong max_conn_mem
Definition: sql_class.h:258
bool m_enabled
Definition: sql_class.h:254
void alloc_cnt(size_t size)
Increase memory counter at 'alloc' operation.
Definition: sql_class.cc:170
void set_thd(THD *thd)
Definition: sql_class.h:273
uint orig_mode
Definition: sql_class.h:262
int generate_error(int err_no, ulonglong mem_limit, ulonglong mem_size)
Generate OOM error and set therad to KILL_CONNECTION state.
Definition: sql_class.cc:355
void disable()
Definition: sql_class.cc:157
uint curr_mode
Definition: sql_class.h:261
bool is_error_log_mode() const
Check if memory counter is in error log mode.
Definition: sql_class.h:324
bool is_connection_stage
Definition: sql_class.h:264
void enable()
Definition: sql_class.h:274
Thd_mem_cnt()
Definition: sql_class.h:268
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t co...
Definition: tztime.h:49
Definition: transaction_info.h:55
This class keeps the context of transactional DDL statements.
Definition: sql_class.h:886
void post_ddl()
End the transactional context created by calling post ddl hook for engine on which table is being cre...
Definition: sql_class.cc:3766
dd::String_type m_tablename
Definition: sql_class.h:915
void init(dd::String_type db, dd::String_type tablename, const handlerton *hton)
Initialize the transactional ddl context when executing CREATE TABLE ... SELECT command with engine w...
Definition: sql_class.cc:3716
~Transactional_ddl_context()
Definition: sql_class.h:892
THD * m_thd
Definition: sql_class.h:908
Transactional_ddl_context(THD *thd)
Definition: sql_class.h:888
dd::String_type m_db
Definition: sql_class.h:914
bool inited()
Definition: sql_class.h:900
const handlerton * m_hton
Definition: sql_class.h:911
void rollback()
Remove the table share used while creating the table, if the transaction is being rolledback.
Definition: sql_class.cc:3734
@ XA_NOTR
Definition: xa.h:298
std::unordered_map, but with my_malloc and collation-aware comparison.
Definition: map_helpers.h:219
RAII class for immunizing the THD from kill operations.
Definition: dd_kill_immunizer.h:46
Definition: dictionary_client.h:149
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4583
Definition: sql_list.h:738
std::unordered_map, but with my_malloc, so that you can track the memory used using PSI memory keys.
Definition: map_helpers.h:157
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
Represents Transaction Source Identifier which is composed of source UUID and transaction tag.
Definition: tsid.h:44
void clear()
Clears data - uuid and tag.
Definition: tsid.cpp:127
Definition: partition_info.h:209
Definition: sp_cache.cc:42
Definition: sp_rcontext.h:77
To be used for pool-of-threads (implemented differently on various OSs)
Definition: sql_class.h:209
void * data
Definition: sql_class.h:211
thd_scheduler()
Definition: sql_class.h:213
Definition: item_func.h:3095
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
#define PSI_THREAD_CALL(M)
Definition: psi_thread.h:36
static char buf[MAX_BUF]
Definition: conf_to_src.cc:73
#define U
Definition: ctype-tis620.cc:74
thread_local THD * current_thd
Definition: current_thd.cc:26
durability_properties
Definition: dur_prop.h:31
static bool report_error(THD *thd, int error_code, Sql_condition::enum_severity_level level, Args... args)
Definition: error_handler.cc:290
Rows_log_event * binlog_get_pending_rows_event(bool is_transactional) const
This function retrieves a pending row event from a cache which is specified through the parameter is_...
Definition: binlog.cc:8598
bool is_ddl_gtid_compatible()
Definition: binlog.cc:9732
bool is_binlog_cache_empty(bool is_transactional) const
Return true if the statement/transaction cache is currently empty, false otherwise.
Definition: binlog.cc:8325
int binlog_write_row(TABLE *table, bool is_transactional, const uchar *new_data, const unsigned char *extra_row_info)
Definition: binlog.cc:10188
int decide_logging_format(Table_ref *tables)
Decide on logging format to use for the statement and issue errors or warnings as needed.
Definition: binlog.cc:9038
void check_and_emit_warning_for_non_composable_engines(Table_ref *table_ref)
Iterates over the table and call check_and_registered_engine and emits error for non-composable engin...
Definition: binlog.cc:8887
bool binlog_configure_trx_cache_size(ulong new_size)
Configure size of binlog transaction cache.
Definition: binlog.cc:8389
int binlog_update_row(TABLE *table, bool is_transactional, const uchar *old_data, const uchar *new_data, const uchar *extra_row_info)
Definition: binlog.cc:10213
Rows_log_event * binlog_prepare_pending_rows_event(TABLE *table, uint32 serv_id, size_t needed, bool is_transactional, const unsigned char *extra_row_info, uint32 source_part_id=INT_MAX)
Definition: binlog.cc:9892
int binlog_delete_row(TABLE *table, bool is_transactional, const uchar *old_data, const unsigned char *extra_row_info)
Definition: binlog.cc:10286
bool is_dml_gtid_compatible(bool some_transactional_table, bool some_non_transactional_table, bool non_transactional_tables_are_tmp)
is_dml_gtid_compatible() and is_ddl_gtid_compatible() check if the statement that is about to be proc...
Definition: binlog.cc:9814
int binlog_query(enum_binlog_query_type qtype, const char *query, size_t query_len, bool is_trans, bool direct, bool suppress_use, int errcode)
Log the current query.
Definition: binlog.cc:10600
void add_to_binlog_accessed_dbs(const char *db)
Definition: binlog.cc:8626
void issue_unsafe_warnings()
Auxiliary method used by binlog_query() to raise warnings.
Definition: binlog.cc:10542
int binlog_write_table_map(TABLE *table, bool is_transactional, bool binlog_rows_query)
This function writes a table map to the binary log.
Definition: binlog.cc:8553
int binlog_setup_trx_data()
Definition: binlog.cc:8350
const uint32_t UNDEFINED_SERVER_VERSION
Definition: binlog_event.h:160
void unlock_global_read_lock(THD *thd)
Unlock global read lock.
Definition: lock.cc:1085
bool lock_global_read_lock(THD *thd)
Take global read lock, wait if there is protection against lock.
Definition: lock.cc:1045
bool make_global_read_lock_block_commit(THD *thd)
Make global read lock also block commits.
Definition: lock.cc:1114
void set_explicit_lock_duration(THD *thd)
Set explicit duration for metadata locks which are used to implement GRL.
Definition: lock.cc:1142
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:287
char * strdup_root(MEM_ROOT *root, const char *str)
Definition: my_alloc.cc:279
void * memdup_root(MEM_ROOT *root, const void *str, size_t len)
Definition: my_alloc.cc:296
MYSQL_PLUGIN_IMPORT CHARSET_INFO * default_charset_info
Definition: charset.cc:181
size_t dirname_length(const char *name)
Get the string length of the directory part of name, including the last FN_LIBCHAR.
Definition: mf_dirname.cc:62
void reset_for_next_command()
Definition: sql_parse.cc:5089
struct PSI_idle_locker PSI_idle_locker
Definition: psi_idle_bits.h:41
unsigned int PSI_stage_key
Instrumented stage key.
Definition: psi_stage_bits.h:43
struct PSI_statement_locker PSI_statement_locker
Definition: psi_statement_bits.h:98
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:82
struct PSI_transaction_locker PSI_transaction_locker
Definition: psi_transaction_bits.h:41
static constexpr unsigned PSI_INSTRUMENT_ME
Definition: psi_bits.h:43
#define mysql_mutex_assert_not_owner(M)
Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes.
Definition: mysql_mutex.h:126
#define mysql_mutex_assert_owner(M)
Wrapper, to use safe_mutex_assert_owner with instrumented mutexes.
Definition: mysql_mutex.h:112
#define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2)
Definition: mysql_statement.h:107
#define MYSQL_SET_STATEMENT_QUERY_ID(LOCKER, P1)
Definition: mysql_statement.h:116
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
Instrumentation helpers for mysys threads.
struct MYSQL_LEX_CSTRING LEX_CSTRING
Definition: lex_string.h:42
enum_locked_tables_mode
Type of locked tables mode.
Definition: locked_tables_list.h:47
@ 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
A better implementation of the UNIX ctype(3) library.
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_latin1
Definition: ctype-latin1.cc:366
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1554
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:48
Header for compiler-dependent features.
#define SUPPRESS_TSAN
Definition: my_compiler.h:130
#define DBUG_EXECUTE_IF(keyword, a1)
Definition: my_dbug.h:171
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
#define MYF(v)
Definition: my_inttypes.h:97
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_END
Definition: my_sqlcommand.h:208
Common header for many mysys elements.
uint64_t table_map
Definition: my_table_map.h:30
Types to make different thread packages compatible.
pthread_t my_thread_t
Definition: my_thread_bits.h:48
uint32 my_thread_id
Definition: my_thread_local.h:34
static int count
Definition: myisam_ftdump.cc:45
static bool backup
Definition: myisampack.cc:198
unsigned int STDCALL mysql_errno(MYSQL *mysql)
Definition: client.cc:9194
@ SERVER_STATUS_IN_TRANS
Is raised when a multi-statement transaction has been started, either explicitly, by means of BEGIN o...
Definition: mysql_com.h:816
#define SCRAMBLE_LENGTH
Length of random string sent by server on handshake; this is also length of obfuscated password,...
Definition: mysql_com.h:128
Definitions private to the server, used in the networking layer to notify specific events.
Instrumentation helpers for conditions.
ABI for instrumented mutexes.
Instrumentation helpers for statements.
char * user
Definition: mysqladmin.cc:66
const char * host
Definition: mysqladmin.cc:65
void error(const char *format,...)
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
bool empty(const Histogram &histogram)
Return true if 'histogram' was built on an empty table.
Definition: histogram.h:693
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
size_t size(const char *const c)
Definition: base64.h:46
bool is_active(space_id_t space_id, bool get_latch=true)
Definition: trx0purge.cc:1157
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2884
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2880
This contains the declaration of class Opt_trace_context, which is needed to declare THD.
Performance schema instrumentation (declarations).
Instrumentation helpers for mutexes.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
PSI_memory_key key_memory_THD_handler_tables_hash
Definition: psi_memory_key.cc:94
PSI_memory_key key_memory_user_var_entry
Definition: psi_memory_key.cc:149
PSI_memory_key key_memory_User_level_lock
Definition: psi_memory_key.cc:98
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
#define OPTION_NOT_AUTOCOMMIT
Definition: query_options.h:74
#define OPTION_BEGIN
Definition: query_options.h:75
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
required uint64 version
Definition: replication_group_member_actions.proto:41
required string event
Definition: replication_group_member_actions.proto:32
enum_check_fields
Definition: field.h:174
enum_tx_isolation
Definition: handler.h:3194
ha_notification_type
Definition: handler.h:940
char empty_c_string[1]
Definition: sql_class.cc:132
PSI_thread * thd_get_psi(THD *thd)
Get reference to Performance Schema object for THD object.
Definition: sql_thd_api.cc:111
void my_message_sql(uint error, const char *str, myf MyFlags)
All global error messages are sent here where the first one is stored for the client.
Definition: mysqld.cc:3942
void my_eof(THD *thd)
A short cut for thd->get_stmt_da()->set_eof_status().
Definition: sql_class.cc:3782
void thd_enter_stage(void *opaque_thd, const PSI_stage_info *new_stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)
Definition: sql_thd_internal_api.cc:212
bool is_xa_tran_detached_on_prepare(const THD *thd)
Returns true if xa transactions are detached as part of executing XA PREPARE.
Definition: sql_class.h:4926
constexpr size_t PREALLOC_NUM_HA
Definition: sql_class.h:197
void thd_exit_cond(void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line)
Set thread leaving a condition.
Definition: sql_thd_internal_api.cc:203
std::stack< Event_tracking_data > Event_tracking_data_stack
Definition: sql_class.h:922
bool add_item_to_list(THD *thd, Item *item)
Definition: sql_class.cc:3099
enum_mem_cnt_mode
Definition: sql_class.h:229
@ MEM_CNT_DEFAULT
Memory counter object doesn't update global memory counter and doesn't throw OOM error.
Definition: sql_class.h:234
@ MEM_CNT_GENERATE_ERROR
if MEM_CNT_GENERATE_ERROR is set, memory counter object generates OOM error if any.
Definition: sql_class.h:244
@ MEM_CNT_UPDATE_GLOBAL_COUNTER
if MEM_CNT_UPDATE_GLOBAL_COUNTER is set, memory counter object updates global memory counter.
Definition: sql_class.h:239
@ MEM_CNT_GENERATE_LOG_ERROR
if MEM_CNT_GENERATE_LOG_ERROR is set, memory counter object generates OOM error to error log if any.
Definition: sql_class.h:249
thread_local TDM expected_from_debug_flag
Definition: sql_class.h:203
Secondary_engine_optimization
Enum that represents which phase of secondary engine optimization the current statement is in.
Definition: sql_class.h:709
@ SECONDARY
The current statement should use tables from a secondary storage engine if possible.
@ PRIMARY_ONLY
The current statement should only use tables from primary storage engines.
@ PRIMARY_TENTATIVELY
The current statement should only use tables from the primary storage engine.
bool is_engine_substitution_allowed(const THD *thd)
Check if engine substitution is allowed in the current thread context.
Definition: sql_class.h:4881
void my_ok(THD *thd, ulonglong affected_rows=0, ulonglong id=0, const char *message=nullptr)
A short cut for thd->get_stmt_da()->set_ok_status().
Definition: sql_class.cc:3776
void thd_enter_cond(void *opaque_thd, mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)
Set thread entering a condition.
Definition: sql_thd_internal_api.cc:190
char const * show_system_thread(enum_thread_type thread)
Definition: sql_class.h:759
#define RETURN_NAME_AS_STRING(NAME)
void thd_set_waiting_for_disk_space(void *opaque_thd, const bool waiting)
Definition: sql_thd_internal_api.cc:223
TDM
Definition: sql_class.h:202
unsigned int thd_get_current_thd_terminology_use_previous()
Return @session.terminology_use_previous for the current THD.
Definition: sql_thd_api.cc:742
std::pair< Event_tracking_class, Event_tracking_information * > Event_tracking_data
Definition: sql_class.h:921
void thd_set_psi(THD *thd, PSI_thread *psi)
Set reference to Performance Schema object for THD object.
Definition: sql_thd_api.cc:132
bool is_rpl_source_older(const THD *thd, uint version)
Return if source replication node is older than the given version.
Definition: sql_class.h:4938
bool secondary_engine_lock_tables_mode(const THD &cthd)
Return lock_tables_mode for secondary engine.
Definition: sql_class.h:4857
struct rpl_event_coordinates LOG_POS_COORD
the struct aggregates two parameters that identify an event uniquely in scope of communication of a p...
I_List< Item_change_record > Item_change_list
Definition: sql_class.h:549
File containing constants that can be used throughout the server.
enum_mark_columns
Definition: sql_const.h:232
Event_tracking_class
Event tracking classes If a new event tracking class is introduced, this class should be kept in sync...
Definition: sql_event_tracking_to_audit_event_mapping.h:41
static MEM_ROOT mem
Definition: sql_servers.cc:100
Our own string classes, used pervasively throughout the executor.
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1101
bool is_empty() const
Return true if sidno is zero (and assert that gno is zero too in this case).
Definition: rpl_gtid.h:1126
void clear()
Set both components to 0.
Definition: rpl_gtid.h:1110
void dbug_print(const Tsid_map *tsid_map, const char *text="", bool need_lock=false) const
Print this Gtid to the trace file if debug is enabled; no-op otherwise.
Definition: rpl_gtid.h:1210
rpl_sidno sidno
SIDNO of this Gtid.
Definition: rpl_gtid.h:1105
Storage engine specific thread local data.
Definition: sql_class.h:790
void * ha_ptr_backup
A memorizer to engine specific "native" transaction object to provide storage engine detach-re-attach...
Definition: sql_class.h:806
void * ha_ptr
Storage engine specific thread local data.
Definition: sql_class.h:795
Ha_data()
Definition: sql_class.h:825
plugin_ref lock
NULL: engine is not bound to this thread non-NULL: engine is bound to this thread,...
Definition: sql_class.h:823
Ha_trx_info ha_info[2]
0: Life time: one statement within a transaction.
Definition: sql_class.h:817
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3844
Definition: binlog_index.h:86
Metadata lock object key.
Definition: mdl.h:366
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
size_t length
Definition: mysql_lex_string.h:42
Definition: mysql_lex_string.h:35
Bison "location" class.
Definition: parse_location.h:43
Definition: mysql_com_server.h:59
Definition: mysql_com.h:914
State data storage for start_idle_wait_v1_t.
Definition: psi_idle_bits.h:52
Stage instrument information.
Definition: psi_stage_bits.h:74
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:63
State data storage for get_thread_statement_locker_v5_t.
Definition: psi_statement_bits.h:166
State data storage for get_thread_transaction_locker_v1_t, get_thread_transaction_locker_v1_t.
Definition: psi_transaction_bits.h:53
Definition: com_data.h:46
Definition: transaction_info.h:46
Per thread status variables.
Definition: system_variables.h:525
ulonglong last_query_partial_plans
Definition: system_variables.h:602
double last_query_cost
Definition: system_variables.h:601
Definition: sql_lexer_thd.h:56
sql_mode_t sql_mode
Definition: sql_lexer_thd.h:59
const CHARSET_INFO * character_set_client
Definition: sql_lexer_thd.h:60
An utility struct for Attachable_trx.
Definition: sql_class.h:2010
bool m_in_lock_tables
THD::in_lock_tables value.
Definition: sql_class.h:2049
void backup(THD *thd)
Definition: sql_class.cc:406
ulonglong m_thd_option_bits
THD options.
Definition: sql_class.h:2040
~Transaction_state()
Definition: sql_class.cc:3107
void restore(THD *thd)
Definition: sql_class.cc:423
PSI_transaction_locker * m_transaction_psi
Current transaction instrumentation.
Definition: sql_class.h:2043
Prealloced_array< Ha_data, PREALLOC_NUM_HA > m_ha_data
Ha_data array.
Definition: sql_class.h:2031
uint m_server_status
Server status flags.
Definition: sql_class.h:2046
bool m_time_zone_used
Current time zone (i.e.
Definition: sql_class.h:2060
bool m_transaction_rollback_request
Transaction rollback request flag.
Definition: sql_class.h:2070
Transaction_ctx * m_trx
Transaction_ctx instance.
Definition: sql_class.h:2034
Open_tables_backup m_open_tables_state
Open-tables state.
Definition: sql_class.h:2022
bool m_tx_read_only
Transaction read-only state.
Definition: sql_class.h:2037
sql_mode_t m_sql_mode
SQL_MODE.
Definition: sql_class.h:2025
Transaction_state()
Definition: sql_class.cc:3103
enum_sql_command m_sql_command
SQL-command.
Definition: sql_class.h:2017
Query_tables_list * m_query_tables_list
Definition: sql_class.h:2019
enum_tx_isolation m_tx_isolation
Transaction isolation level.
Definition: sql_class.h:2028
Definition: sql_timer.cc:54
Definition: thr_lock.h:119
For locks with EXPLICIT duration, MDL returns a new ticket every time a lock is granted.
Definition: item_func.cc:5361
Definition: violite.h:320
void * ssl_arg
Definition: violite.h:416
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2740
Replacement of system's struct timeval to ensure we can carry 64 bit values even on a platform which ...
Definition: my_time_t.h:45
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: mysql_com.h:1109
Definition: resource_group_basic_types.h:54
the struct aggregates two parameters that identify an event uniquely in scope of communication of a p...
Definition: sql_class.h:338
my_off_t pos
Definition: sql_class.h:340
char * file_name
Definition: sql_class.h:339
State data storage for digest_start, digest_add_token.
Definition: sql_digest_stream.h:36
Definition: sql_audit.h:56
Definition: sql_plugin_ref.h:45
Definition: mysqlslap.cc:219
Definition: sql_connect.h:70
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: xa.h:83
constexpr sql_mode_t MODE_NO_ENGINE_SUBSTITUTION
Definition: system_variables.h:154
constexpr sql_mode_t MODE_TIME_TRUNCATE_FRACTIONAL
Definition: system_variables.h:161
constexpr sql_mode_t MODE_STRICT_TRANS_TABLES
Definition: system_variables.h:135
enum_binlog_format
Definition: system_variables.h:46
@ BINLOG_FORMAT_MIXED
statement if safe, otherwise row - autodetected
Definition: system_variables.h:47
@ BINLOG_FORMAT_ROW
row-based
Definition: system_variables.h:49
@ BINLOG_FORMAT_STMT
statement-based
Definition: system_variables.h:48
constexpr sql_mode_t MODE_STRICT_ALL_TABLES
Definition: system_variables.h:137
thr_lock_type
Definition: thr_lock.h:51
enum_thread_type
Definition: thread_type.h:34
@ NON_SYSTEM_THREAD
Definition: thread_type.h:35
@ SYSTEM_THREAD_BACKGROUND
Definition: thread_type.h:44
@ SYSTEM_THREAD_INIT_FILE
Definition: thread_type.h:48
@ SYSTEM_THREAD_SLAVE_IO
Definition: thread_type.h:36
@ SYSTEM_THREAD_EVENT_SCHEDULER
Definition: thread_type.h:39
@ SYSTEM_THREAD_COMPRESS_GTID_TABLE
Definition: thread_type.h:43
@ SYSTEM_THREAD_SLAVE_WORKER
Definition: thread_type.h:42
@ SYSTEM_THREAD_DD_RESTART
Definition: thread_type.h:46
@ SYSTEM_THREAD_SERVER_UPGRADE
Definition: thread_type.h:49
@ SYSTEM_THREAD_SERVER_INITIALIZE
Definition: thread_type.h:47
@ SYSTEM_THREAD_SLAVE_SQL
Definition: thread_type.h:37
@ SYSTEM_THREAD_DD_INITIALIZE
Definition: thread_type.h:45
@ SYSTEM_THREAD_INFO_REPOSITORY
Definition: thread_type.h:41
@ SYSTEM_THREAD_EVENT_WORKER
Definition: thread_type.h:40
@ SYSTEM_THREAD_NDBCLUSTER_BINLOG
Definition: thread_type.h:38
Include file for Sun RPC to compile out of the box.
command
Definition: version_token.cc:280
enum_vio_type
Definition: violite.h:79
#define SSL_handle
Definition: violite.h:454