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);
1380 return pointer_cast<const Protocol_classic *>(
m_protocol);
1503 const char *calling_func,
const char *calling_file,
1723 bool binlog_rows_query);
1726 const unsigned char *extra_row_info);
1728 const uchar *old_data,
1729 const unsigned char *extra_row_info);
1732 const uchar *extra_row_info);
1738 template <
class RowsEventT>
1741 const unsigned char *extra_row_info,
uint32 source_part_id = INT_MAX);
2465#if defined(ENABLED_PROFILING)
2480#ifdef HAVE_PSI_STATEMENT_INTERFACE
2487#ifdef HAVE_PSI_TRANSACTION_INTERFACE
2494#ifdef HAVE_PSI_IDLE_INTERFACE
2645 assert(((
file ==
nullptr) && (pos == 0)) ||
2646 ((
file !=
nullptr) && (pos != 0)));
2662 (
"m_trans_log_file: %s, m_trans_fixed_log_file: %s, "
2663 "m_trans_end_pos: %llu",
2673 (
"file: %s, pos: %llu", file_var ? *file_var :
"<none>",
2674 pos_var ? *pos_var : 0));
2683 (
"file: %s, pos: %llu", file_var ? *file_var :
"<none>",
2684 pos_var ? *pos_var : 0));
2868#if defined(ENABLED_DEBUG_SYNC)
2870 struct st_debug_sync_control *debug_sync_control;
2884 explicit THD(
bool enable_plugins =
true);
2935 enum_thd_life_cycle_stages::ACTIVE};
3021 void disconnect(
bool server_shutdown =
false);
3034 size_t query_len,
bool is_trans,
bool direct,
3035 bool suppress_use,
int errcode);
3041 const char *src_function,
const char *src_file,
3042 int src_line)
override {
3052 enter_stage(stage, old_stage, src_function, src_file, src_line);
3057 const char *src_file,
int src_line)
override {
3069 enter_stage(stage,
nullptr, src_function, src_file, src_line);
3105 bool needs_thr_lock_abort)
override;
3108 bool *victimized)
override;
3237 const char *from,
size_t from_length,
3259 bool is_connected(
bool use_cached_connection_alive =
false) final;
3330 bool copy_conditions =
true) {
3348 template <
typename ProtocolClass>
3369 DBUG_PRINT(
"info", (
"change_item_tree place %p old_value %p new_value %p",
3370 place, *place, new_value));
3400 uint add_state_flags);
3512 return variables.gtid_next_list.is_non_null
3846 auto xid_state = trx->xid_state();
3861 auto xid_state = trx->xid_state();
3865#ifdef HAVE_GTID_NEXT_LIST
3890#ifdef HAVE_GTID_NEXT_LIST
3891 owned_gtid_set.
clear();
3974#ifdef HAVE_PSI_THREAD_INTERFACE
3994 return copy_db_to(
const_cast<char const **
>(p_db), p_db_length);
4114 uint code,
const char *message_text);
4184 size_t query_length_arg [[maybe_unused]]) {
4187 static_cast<uint
>(query_length_arg));
4188#ifdef HAVE_PSI_THREAD_INTERFACE
4191 (query_arg,
static_cast<uint
>(query_length_arg));
4216 void set_query(
const char *query_arg,
size_t query_length_arg) {
4217 const LEX_CSTRING tmp = {query_arg, query_length_arg};
4372 bool some_non_transactional_table,
4373 bool non_transactional_tables_are_tmp);
4457 MY_ATTRIBUTE((format(printf, 2, 3)));
4464 MY_ATTRIBUTE((format(printf, 3, 4)));
4468 MY_ATTRIBUTE((format(printf, 3, 0)));
4469 void vsyntax_error_at(const
char *pos_in_lexer_raw_buffer, const
char *format,
4470 va_list args) MY_ATTRIBUTE((format(printf, 3, 0)));
4801 unsigned long subevent,
bool check_audited);
4837 const char *message =
nullptr);
4900 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:1556
void clear()
Removes all gtids from this Gtid_set.
Definition: rpl_gtid_set.cc:265
Either statement transaction or normal transaction - related thread-specific storage engine data.
Definition: transaction_info.h:403
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:936
Definition: sql_list.h:467
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:85
Context of the owner of metadata locks.
Definition: mdl.h:1412
void set_explicit_duration_for_all_locks()
Set explicit duration for all locks in the context.
Definition: mdl.cc:4632
Savepoint for MDL context.
Definition: mdl.h:1317
A granted metadata lock.
Definition: mdl.h:985
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:619
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:604
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:93
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:2077
void claim_memory_ownership(bool claim)
Definition: sql_class.cc:2139
Prepared_statement * find_by_name(const LEX_CSTRING &name)
Find prepared statement by name.
Definition: sql_class.cc:2114
int insert(Prepared_statement *statement)
Insert a new statement to the thread-local prepared statement map.
Definition: sql_class.cc:2083
Prepared_statement * m_last_found_statement
Definition: sql_class.h:525
~Prepared_statement_map()
Definition: sql_class.cc:2163
void reset()
Definition: sql_class.cc:2145
void erase(Prepared_statement *statement)
Erase all prepared statements (calls Prepared_statement destructor).
Definition: sql_class.cc:2128
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:2119
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:152
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:2041
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:2052
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:2036
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:2058
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:2597
Definition: rpl_rli.h:203
An interface that is used to take an action when the locking module notices that a table version has ...
Definition: sql_prepare.h:82
Common base class for all row-containing log events.
Definition: log_event.h:2764
Definition: rpl_context.h:408
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:2104
bool is_read_only() const override
Definition: sql_class.h:2106
Attachable_trx_rw(const Attachable_trx_rw &)
Attachable_trx_rw & operator=(const Attachable_trx_rw &)
Attachable_trx_rw(THD *thd)
Definition: sql_class.cc:535
Class representing read-only attachable transaction, encapsulates knowledge how to backup state of cu...
Definition: sql_class.h:2061
THD * m_thd
THD instance.
Definition: sql_class.h:2072
Transaction_state m_trx_state
Transaction state data.
Definition: sql_class.h:2083
virtual ~Attachable_trx()
Definition: sql_class.cc:491
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:2080
Attachable_trx(THD *thd, Attachable_trx *prev_trx)
Definition: sql_class.cc:396
virtual bool is_read_only() const
Definition: sql_class.h:2068
enum_reset_lex m_reset_lex
Definition: sql_class.h:2074
Attachable_trx * get_prev_attachable_trx() const
Definition: sql_class.h:2065
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:1404
void set_query_plan(enum_sql_command sql_cmd, LEX *lex_arg, bool ps)
Set query plan.
Definition: sql_class.cc:2701
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:2696
bool is_single_table_plan() const
Definition: sql_class.cc:3037
THD *const thd
Definition: sql_class.h:1406
Query_plan & operator=(const Query_plan &)
not defined
Query_plan(const Query_plan &)
not defined
bool is_ps_query() const
Definition: sql_class.h:1459
LEX * lex
LEX of topmost statement.
Definition: sql_class.h:1410
bool is_ps
True if query is run in prepared statement.
Definition: sql_class.h:1414
const Modification_plan * modification_plan
Query plan for UPDATE/DELETE/INSERT/REPLACE.
Definition: sql_class.h:1412
Modification_plan const * get_modification_plan() const
Definition: sql_class.h:1455
enum_sql_command get_command() const
Definition: sql_class.h:1447
LEX * get_lex() const
Definition: sql_class.h:1451
Query_plan(THD *thd_arg)
Definition: sql_class.h:1429
enum_sql_command sql_command
Original sql_command;.
Definition: sql_class.h:1408
void set_modification_plan(Modification_plan *plan_arg)
Definition: sql_class.cc:2717
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:1340
enum_vio_type get_vio_type() const
Definition: sql_class.cc:1954
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:1563
bool has_gtid_consistency_violation
Definition: sql_class.h:3935
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:3890
Rpl_thd_context rpl_thd_ctx
Definition: sql_class.h:3880
struct THD_timer_info * timer
Holds active timer object.
Definition: sql_class.h:1856
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:3064
uint fill_variables_recursion_level
Definition: sql_class.h:1661
thd_scheduler scheduler
Definition: sql_class.h:3997
ulonglong first_successful_insert_id_in_prev_stmt_for_binlog
Definition: sql_class.h:2205
mysql_mutex_t LOCK_thd_query
Protects THD::m_query_string.
Definition: sql_class.h:1238
PSI_statement_locker * m_statement_psi
Current statement instrumentation.
Definition: sql_class.h:2479
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:1644
bool m_is_admin_conn
Definition: sql_class.h:1601
PSI_transaction_locker_state m_transaction_state
Current transaction instrumentation state.
Definition: sql_class.h:2489
PSI_stage_progress * m_stage_progress_psi
Current stage progress instrumentation.
Definition: sql_class.h:2470
std::atomic< bool > m_is_system_user
Flag that indicates if the user of current session has SYSTEM_USER privilege.
Definition: sql_class.h:4708
void cleanup_connection(void)
Definition: sql_class.cc:1176
Gtid owned_gtid
The GTID of the currently owned transaction.
Definition: sql_class.h:3771
sql_digest_state * m_digest
Current statement digest.
Definition: sql_class.h:2472
Diagnostics_area m_query_rewrite_plugin_da
Definition: sql_class.h:4405
void clear_binlog_local_stmt_filter()
Definition: sql_class.h:1841
struct System_status_var * initial_status_var
Definition: sql_class.h:1151
ulonglong first_successful_insert_id_in_cur_stmt
Definition: sql_class.h:2211
void store_globals()
Definition: sql_class.cc:1713
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:4693
void push_lock_usec(ulonglong &top)
Definition: sql_class.h:1629
rpl_event_coordinates binlog_next_event_pos
Definition: sql_class.h:1706
void reset_n_backup_open_tables_state(Open_tables_backup *backup, uint add_state_flags)
Definition: sql_class.cc:2207
void claim_memory_ownership(bool claim)
Claim all the memory used by the THD object.
Definition: sql_class.cc:2943
void inc_status_select_range()
Definition: sql_class.cc:2438
void set_row_count_func(longlong row_count_func)
Definition: sql_class.h:2397
std::unordered_map< unsigned int, void * > external_store_
Definition: sql_class.h:4788
bool is_a_srv_session() const
Definition: sql_class.h:4574
void set_catalog(const LEX_CSTRING &catalog)
Definition: sql_class.h:1470
void clear_binlog_table_maps()
Definition: sql_class.h:1966
void enable_low_level_commit_ordering()
Enables ordering in ha_commit_low.
Definition: sql_class.cc:3022
void unlock_query_plan()
Definition: sql_class.h:1298
void get_trans_pos(const char **file_var, my_off_t *pos_var) const
Definition: sql_class.h:2668
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:2977
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:1660
longlong m_row_count_func
Stores the result of ROW_COUNT() function.
Definition: sql_class.h:2392
unsigned long bind_parameter_values_count
the number of elements in parameters
Definition: sql_class.h:4745
bool is_current_stmt_binlog_disabled() const
Determine if binlogging is currently disabled for this session.
Definition: sql_class.cc:3003
PS_PARAM * bind_parameter_values
The parameter value bindings for the current query.
Definition: sql_class.h:4743
static const int OWNED_SIDNO_GTID_SET
Definition: sql_class.h:3772
Discrete_intervals_list auto_inc_intervals_forced
Definition: sql_class.h:2257
void set_psi(PSI_thread *psi)
Save the performance schema thread instrumentation associated with this user session.
Definition: sql_class.h:4015
bool add_external(unsigned int slot, void *data)
Definition: sql_class.cc:3260
void request_persist_gtid_by_se()
Request SE to persist GTID explicitly.
Definition: sql_class.h:3831
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:4216
const String normalized_query()
The current query in normalized form.
Definition: sql_class.cc:3042
void reset_query_for_display()
Reset query string to be displayed in PFS.
Definition: sql_class.h:4200
PSI_thread * get_psi() const
Read the performance schema thread instrumentation associated with this user session.
Definition: sql_class.h:4022
void init_cost_model()
Initialize the optimizer cost model.
Definition: sql_class.cc:3729
std::bitset< SE_GTID_MAX > Se_GTID_flagset
Definition: sql_class.h:3797
ulong statement_id_counter
Definition: sql_class.h:2512
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:3039
bool is_log_reset() const
Definition: sql_class.h:3825
bool slave_thread
Definition: sql_class.h:2744
bool m_is_fatal_error
Set to true if execution of the current compound statement can not continue.
Definition: sql_class.h:2756
void shutdown_active_vio()
Definition: sql_class.cc:1959
std::unique_ptr< Protocol_binary > protocol_binary
Definition: sql_class.h:1353
bool is_waiting_for_disk_space() const
Returns the current waiting_for_disk_space flag value.
Definition: sql_class.h:4655
uint dbug_sentry
Definition: sql_class.h:1542
ulonglong first_successful_insert_id_in_prev_stmt
Definition: sql_class.h:2198
Diagnostics_area main_da
Definition: sql_class.h:4403
dd::cache::Dictionary_client * dd_client() const
Definition: sql_class.h:1002
enum_binlog_query_type
Definition: sql_class.h:3023
@ ROW_QUERY_TYPE
Definition: sql_class.h:3025
@ QUERY_TYPE_COUNT
Definition: sql_class.h:3030
@ STMT_QUERY_TYPE
Definition: sql_class.h:3028
SSL_handle m_SSL
SSL data attached to this connection.
Definition: sql_class.h:1397
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:2737
LEX_CSTRING m_invoker_host
Definition: sql_class.h:4428
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:2866
bool is_applier_thread() const
Definition: sql_class.h:1978
void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
Definition: sql_class.h:4378
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:1160
XID debug_binlog_xid_last
Definition: sql_class.h:4625
PSI_statement_locker_state m_statement_state
Current statement instrumentation state.
Definition: sql_class.h:2482
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:3058
const st_plugin_int * m_plugin
Stores the plugin id it is attached to (if any).
Definition: sql_class.h:4603
void pop_diagnostics_area()
Pop the top DA off the Diagnostics Area stack.
Definition: sql_class.h:3336
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:4419
MDL_context mdl_context
Definition: sql_class.h:966
void unpin_gtid()
Unpin and free GTID and TSID.
Definition: sql_class.h:3806
mysql_cond_t COND_thr_lock
Condition variable used for waiting by the THR_LOCK.c subsystem.
Definition: sql_class.h:1567
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:1647
bool running_explain_analyze
Whether we are currently in the execution phase of an EXPLAIN ANALYZE query.
Definition: sql_class.h:2728
void clear_current_query_costs()
Clear the query costs attributes for the current query.
Definition: sql_class.h:1175
bool has_invoker() const
Definition: sql_class.h:4386
std::unique_ptr< Protocol_text > protocol_text
Definition: sql_class.h:1352
void increment_updates_counter()
Definition: sql_class.cc:2658
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:1516
collation_unordered_map< std::string, unique_ptr_my_free< Table_ref > > handler_tables_hash
Definition: sql_class.h:1532
enum_tx_isolation tx_isolation
Definition: sql_class.h:2597
bool is_error() const
true if there is an error in the error stack.
Definition: sql_class.h:3281
unsigned char * m_token_array
Current statement digest token array.
Definition: sql_class.h:2474
void set_ssl(Vio *vio)
Definition: sql_class.h:2976
void save_current_query_costs()
Save the current query costs attributes in the thread session status.
Definition: sql_class.h:1190
bool is_cleanup_done()
Definition: sql_class.cc:1228
my_off_t m_trans_end_pos
Definition: sql_class.h:1930
void restore_sub_statement_state(Sub_statement_state *backup)
Definition: sql_class.cc:2320
THD * get_thd() override
Within MDL subsystem this one is only used for DEBUG_SYNC.
Definition: sql_class.h:3085
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:2532
bool skip_transaction_read_only_check
Definition: sql_class.h:1874
my_thread_id thread_id() const
Definition: sql_class.h:2534
resourcegroups::Resource_group_ctx * resource_group_ctx()
Get resource group context.
Definition: sql_class.h:4005
void set_trans_pos(const char *file, my_off_t pos)
Functions to set and get transaction position.
Definition: sql_class.h:2643
my_thread_t real_id
Definition: sql_class.h:2514
void push_protocol(const std::unique_ptr< ProtocolClass > &protocol)
Definition: sql_class.h:3349
void begin_attachable_rw_transaction()
Start a read-write attachable transaction.
Definition: sql_class.cc:2242
void lock_query_plan()
Locks the query plan of this THD.
Definition: sql_class.h:1297
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:1999
ha_rows get_examined_row_count() const
Definition: sql_class.h:2443
void get_trans_fixed_pos(const char **file_var, my_off_t *pos_var) const
Definition: sql_class.h:2678
bool copy_db_to(char **p_db, size_t *p_db_length) const
Definition: sql_class.h:3993
void set_security_context(Security_context *sctx)
Definition: sql_class.h:1325
void send_kill_message() const
Definition: sql_class.cc:2171
void inc_status_select_scan()
Definition: sql_class.cc:2454
Event_tracking_data_stack event_tracking_data_
Definition: sql_class.h:4815
void reset_gtid_persisted_by_se()
Reset by SE at transaction end after persisting GTID.
Definition: sql_class.h:3837
bool tx_commit_pending
Definition: sql_class.h:1080
USER_CONN * m_user_connect
Definition: sql_class.h:2423
void swap_rewritten_query(String &query_arg)
Set the rewritten query (with passwords obfuscated etc.) on the THD.
Definition: sql_class.cc:3137
Cost_model_server m_cost_model
Optimizer cost model for server operations.
Definition: sql_class.h:4436
char scramble[SCRAMBLE_LENGTH+1]
Definition: sql_class.h:2740
my_timeval query_start_timeval_trunc(uint decimals)
Definition: sql_class.cc:994
void inc_status_sort_scan()
Definition: sql_class.cc:2487
PSI_stage_key m_current_stage_key
Definition: sql_class.h:1473
Relay_log_info * rli_slave
Definition: sql_class.h:1077
uint open_options
Definition: sql_class.h:2536
double double_value
Definition: sql_class.h:2816
List< Security_context > m_view_ctx_list
Definition: sql_class.h:1337
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:3013
Query_arena * stmt_arena
Definition: sql_class.h:2176
enum_binlog_format current_stmt_binlog_format
Indicates the format in which the current statement will be logged.
Definition: sql_class.h:1888
void reset_query()
Definition: sql_class.h:4221
void clear_clone_vio()
Clear clone network Vio for remote clone.
Definition: sql_class.h:2998
void inc_status_created_tmp_tables()
Definition: sql_class.cc:2414
uint get_rand_seed() const override
Provide thread specific random seed for MDL_context's PRNG.
Definition: sql_class.h:3123
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:2408
std::atomic< PSI_thread * > m_psi
Performance schema thread instrumentation for this session.
Definition: sql_class.h:4032
void raise_error_printf(uint code,...)
Raise an exception condition, with a formatted message.
Definition: sql_class.cc:944
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:1592
void set_status_no_index_used()
Definition: sql_class.cc:2495
static const int OWNED_SIDNO_ANONYMOUS
Definition: sql_class.h:3773
bool push_event_tracking_data(Event_tracking_class event, const Event_tracking_information *Event_tracking_information)
Definition: sql_class.cc:3297
Vio * clone_vio
Definition: sql_class.h:2137
bool is_server_upgrade_thread() const
Definition: sql_class.h:2569
void end_statement()
Definition: sql_class.cc:2064
LEX_CSTRING m_query_string
The query associated with this statement.
Definition: sql_class.h:1013
const CHARSET_INFO * collation()
Definition: sql_class.h:3131
bool charset_is_collation_connection
Definition: sql_class.h:2794
LEX_CSTRING m_invoker_user
It points to the invoker in the Query_log_event.
Definition: sql_class.h:4427
bool is_extrenal_xa() const
Definition: sql_class.h:3859
void reset_binlog_local_stmt_filter()
Definition: sql_class.h:1837
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:1285
void time_out_user_resource_limits()
Definition: sql_class.cc:2681
void clear_active_vio()
Definition: sql_class.h:2982
const Protocol * get_protocol() const
Definition: sql_class.h:1355
ulonglong m_lock_usec
Time spent waiting for TABLE locks and DATA locks.
Definition: sql_class.h:1624
bool need_binlog_invoker() const
Definition: sql_class.h:4376
bool is_dd_system_thread() const
Definition: sql_class.h:2543
ulong max_client_packet_length
Definition: sql_class.h:1529
int thd_tx_priority
Definition: sql_class.h:2613
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:1851
uchar * binlog_row_event_extra_data
Definition: sql_class.h:1715
THR_LOCK_INFO lock_info
Definition: sql_class.h:1224
bool derived_tables_processing
Definition: sql_class.h:2798
void pop_event_tracking_data()
Definition: sql_class.cc:3342
void record_first_successful_insert_id_in_cur_stmt(ulonglong id_arg)
Definition: sql_class.h:2294
long long_value
Definition: sql_class.h:2813
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:4064
bool in_loadable_function
Definition: sql_class.h:4792
bool send_result_set_row(const mem_root_deque< Item * > &row_items)
Send one result set row.
Definition: sql_class.cc:2890
bool is_system_thread() const
Definition: sql_class.h:2540
void set_admin_connection(bool admin)
Definition: sql_class.h:1604
class THD::Query_plan query_plan
void reset_sub_statement_state(Sub_statement_state *backup, uint new_state)
Definition: sql_class.cc:2277
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:4600
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:1153
ulonglong current_found_rows
Dynamic, collected and set also in subqueries.
Definition: sql_class.h:2335
void increment_questions_counter()
Definition: sql_class.cc:2664
void increment_user_connections_counter()
Definition: sql_class.cc:2639
void set_clone_vio(Vio *vio)
Set active clone network Vio for remote clone.
Definition: sql_class.h:2991
Time_zone * time_zone()
Definition: sql_class.h:3135
void set_system_user(bool system_user_flag)
Sets the system_user flag atomically for the current session.
Definition: sql_class.h:4873
const Diagnostics_area * get_stmt_da() const
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3287
query_id_t query_id
Definition: sql_class.h:2509
void set_safe_display(bool safe)
Set if the query string to be safe to display.
Definition: sql_class.h:4210
ulonglong get_lock_usec()
Definition: sql_class.h:1627
Session_sysvar_resource_manager session_sysvar_res_mgr
Definition: sql_class.h:4453
void send_statement_status()
Definition: sql_class.cc:2907
bool is_connected(bool use_cached_connection_alive=false) final
Return false if connection to client is broken.
Definition: sql_class.cc:3177
const char * thread_stack
Definition: sql_class.h:1306
LEX_CSTRING get_invoker_user() const
Definition: sql_class.h:4384
bool fill_information_schema_tables() const
Definition: sql_class.h:3232
void set_waiting_for_disk_space(bool waiting)
Set the waiting_for_disk_space flag.
Definition: sql_class.h:4649
std::atomic< mysql_mutex_t * > current_mutex
The mutex used with current_cond.
Definition: sql_class.h:1553
void decrement_user_connections_counter()
Definition: sql_class.cc:2645
~THD() override
Definition: sql_class.cc:1438
my_thread_id m_thread_id
This counter is 32 bit because of the client protocol.
Definition: sql_class.h:2526
void set_command(enum enum_server_command command)
Definition: sql_class.cc:2509
bool event_notify(struct st_mysql_event_generic *event_data)
Definition: sql_class.cc:3350
bool is_admin_connection() const
Definition: sql_class.h:1605
Protocol * m_protocol
Definition: sql_class.h:1386
void set_current_stmt_binlog_format_row_if_mixed()
Definition: sql_class.h:3456
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:1154
void fatal_error()
Mark the current error as fatal.
Definition: sql_class.h:3266
void set_connection_admin(bool connection_admin_flag)
Sets the connection_admin flag atomically for the current session.
Definition: sql_class.h:4892
const LEX_CSTRING & catalog() const
Definition: sql_class.h:1468
void clear_next_event_pos()
Definition: sql_class.cc:2598
void set_server_id(uint32 sid)
Definition: sql_class.h:1733
bool m_secondary_engine_forced
Flag that tells whether secondary storage engine is forced for execution.
Definition: sql_class.h:4701
bool set_db(const LEX_CSTRING &new_db)
Set the current database; use deep copy of C-string.
Definition: sql_class.cc:883
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:3056
bool is_engine_ha_data_detached() const
Definition: sql_class.cc:2997
bool is_attachable_ro_transaction_active() const
Definition: sql_class.h:3433
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:1007
struct THD::@176 binlog_evt_union
PSI_transaction_locker * m_transaction_psi
Current transaction instrumentation.
Definition: sql_class.h:2486
void set_query_id(query_id_t new_query_id)
Assign a new value to thd->query_id.
Definition: sql_class.h:4269
Session_tracker session_tracker
Definition: sql_class.h:4452
const LEX_CSTRING & query() const
Definition: sql_class.h:4158
bool enable_slow_log
Definition: sql_class.h:2796
Internal_error_handler * pop_internal_handler()
Remove the error handler last pushed.
Definition: sql_class.cc:932
bool audit_plugins_present
Definition: sql_class.h:4816
Event_tracking_data get_event_tracking_data()
Definition: sql_class.h:4795
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:3073
struct timeval user_time
Definition: sql_class.h:1613
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:1861
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:2776
bool optimizer_switch_flag(ulonglong flag) const
Tells whether the given optimizer_switch flag is on.
Definition: sql_class.h:1827
Diagnostics_area * m_query_rewrite_plugin_da_ptr
Definition: sql_class.h:4406
void vsyntax_error_at(const POS &location, const char *format, va_list args)
Definition: sql_class.cc:2811
longlong get_row_count_func() const
Definition: sql_class.h:2395
ulong rand_saved_seed2
Definition: sql_class.h:2513
enum THD::Commit_error commit_error
ulonglong previous_found_rows
Stores the result of the FOUND_ROWS() function.
Definition: sql_class.h:2329
int binlog_flush_pending_rows_event(bool stmt_end)
Definition: sql_class.h:1743
void inc_status_sort_rows(ha_rows count)
Definition: sql_class.cc:2478
enum durability_properties durability_property
Definition: sql_class.h:2706
bool waiting_for_disk_space
Definition: sql_class.h:4641
SSL_handle get_ssl() const
Definition: sql_class.h:1359
bool m_audited
Definition: sql_class.h:2882
void clear_current_stmt_binlog_format_row()
Definition: sql_class.h:3485
void set_user_connect(USER_CONN *uc)
Definition: sql_class.cc:2633
enum enum_server_command get_command() const
Definition: sql_class.h:4136
bool is_regular() const =delete
double m_current_query_cost
Current query cost.
Definition: sql_class.h:1164
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:3074
Discrete_intervals_list auto_inc_intervals_in_cur_stmt_for_binlog
Definition: sql_class.h:2255
bool tx_read_only
Definition: sql_class.h:2602
void syntax_error_at(const POS &location)
Definition: sql_class.h:4460
Prealloced_array< Ha_data, PREALLOC_NUM_HA > ha_data
Definition: sql_class.h:1665
const CHARSET_INFO * db_charset
Definition: sql_class.h:2464
int is_current_stmt_binlog_format_row() const
Determine the binlog format of the current statement.
Definition: sql_class.h:1757
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:3518
void set_next_event_pos(const char *_filename, ulonglong _pos)
Definition: sql_class.cc:2582
bool is_mem_cnt_error()
Definition: sql_class.h:4775
void set_plugin(const st_plugin_int *plugin)
Sets the plugin id to the value provided as parameter.
Definition: sql_class.h:4586
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:1378
String packet
Definition: sql_class.h:1935
void set_tmp_table_seq_id(uint arg)
Definition: sql_class.h:4589
bool stmt_depends_on_first_successful_insert_id_in_prev_stmt
Definition: sql_class.h:2240
void push_internal_handler(Internal_error_handler *handler)
Add an internal error handler to the thread execution context.
Definition: sql_class.cc:911
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:1208
bool is_operating_gtid_table_implicitly
Definition: sql_class.h:2343
void syntax_error()
Definition: sql_class.h:4455
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:919
Event_reference_caching_cache * events_cache_
Definition: sql_class.h:4814
void set_current_stmt_binlog_format_row()
Definition: sql_class.h:3480
Prepared_statement_map stmt_map
All prepared statements of this connection.
Definition: sql_class.h:1301
uint server_status
Definition: sql_class.h:2536
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:878
bool bool_value
Definition: sql_class.h:2812
bool is_killable
Definition: sql_class.h:1544
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:4183
bool is_system_user()
Returns if the user of the session has the SYSTEM_USER privilege or not.
Definition: sql_class.h:4864
bool is_current_stmt_binlog_log_replica_updates_disabled() const
Determine if binlogging is currently disabled for this session.
Definition: sql_class.cc:3008
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:2516
void force_one_auto_inc_interval(ulonglong next_id)
Definition: sql_class.h:2320
uint64_t sql_mode_t
Definition: sql_lexer_thd.h:38
sp_rcontext * sp_runtime_ctx
Current SP-runtime context.
Definition: sql_class.h:2803
void inc_examined_row_count(ha_rows count)
Definition: sql_class.cc:2401
bool is_strict_mode() const
Definition: sql_class.h:3127
bool skip_gtid_rollback
Definition: sql_class.h:3918
Parser_state * m_parser_state
Internal parser state.
Definition: sql_lexer_thd.h:66
void update_charset()
Definition: sql_class.cc:1904
void inc_status_select_full_join()
Definition: sql_class.cc:2422
List< char > * get_binlog_accessed_db_names() const
Definition: sql_class.h:1971
void pop_protocol()
Pops the top protocol of the Protocol stack and sets the previous one as the current protocol.
Definition: sql_class.cc:3220
void enable_mem_cnt()
Definition: sql_class.h:4768
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:4738
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:3017
void set_binlog_local_stmt_filter()
Definition: sql_class.h:1846
bool is_cmd_skip_readonly() const
Definition: sql_class.h:1948
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:1641
enum enum_thread_type system_thread
Definition: sql_class.h:2537
void clear_copy_status_var()
Clear copy of the status variables.
Definition: sql_class.h:1199
void raise_note_printf(uint code,...)
Raise an completion condition (note), with a formatted message.
Definition: sql_class.cc:981
bool is_mem_cnt_error_issued
Definition: sql_class.h:4774
void reset_skip_transaction_read_only_check()
Definition: sql_class.h:1958
const char * current_key_name
Definition: sql_class.h:4772
ha_rows num_truncated_fields
Definition: sql_class.h:2401
partition_info * work_part_info
Definition: sql_class.h:2854
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:4821
void * fetch_external(unsigned int slot)
Definition: sql_class.cc:3268
bool is_attachable_transaction_active() const
Definition: sql_class.h:3440
enum_thd_life_cycle_stages
Represents life cycle stages of THD instance.
Definition: sql_class.h:2926
@ ACTIVE_AND_CLEAN
Definition: sql_class.h:2928
@ SCHEDULED_FOR_DISPOSAL
Definition: sql_class.h:2929
@ RESOURCES_RELEASED
Definition: sql_class.h:2931
@ DISPOSED
Definition: sql_class.h:2932
@ ACTIVE
Definition: sql_class.h:2927
@ CLEANED_UP
Definition: sql_class.h:2930
System_variables variables
Definition: sql_lexer_thd.h:64
void set_log_reset()
Set when binlog reset operation is started.
Definition: sql_class.h:3819
struct rand_struct rand
Definition: sql_class.h:1145
bool is_slave_error
True if a slave error.
Definition: sql_class.h:2786
List< char > * binlog_accessed_db_names
Definition: sql_class.h:1912
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:2606
bool is_stmt_prepare_or_first_stmt_execute() const =delete
binlog_filter_state
Definition: sql_class.h:1831
@ BINLOG_FILTER_CLEAR
Definition: sql_class.h:1833
@ BINLOG_FILTER_UNKNOWN
Definition: sql_class.h:1832
@ BINLOG_FILTER_SET
Definition: sql_class.h:1834
bool is_init_file_system_thread() const
Definition: sql_class.h:2556
void set_secondary_engine_forced(bool forced)
Indicate whether secondary storage engine is forced for this execution.
Definition: sql_class.h:4682
ha_rows m_examined_row_count
Number of rows read and/or evaluated for a statement.
Definition: sql_class.h:2420
bool query_start_usec_used
Definition: sql_class.h:2777
time_t query_start_in_secs() const
Definition: sql_class.h:3139
THD * next_to_commit
Used by MYSQL_BIN_LOG to maintain the commit queue for binary log group commit.
Definition: sql_class.h:2625
void set_transaction(Transaction_ctx *transaction_ctx)
Changes the Transaction_ctx instance within THD-object.
Definition: sql_class.cc:871
enum_thd_life_cycle_stages m_thd_life_cycle_stage
Definition: sql_class.h:2934
mysql_mutex_t LOCK_group_replication_connection_mutex
Definition: sql_class.h:4765
void raise_warning_printf(uint code,...)
Raise a completion condition (warning), with a formatted message.
Definition: sql_class.cc:961
bool is_classic_protocol() const
Definition: sql_class.cc:3172
Prealloced_array< Binlog_user_var_event *, 2 > user_var_events
Definition: sql_class.h:2618
PSI_stage_key get_current_stage_key() const
Definition: sql_class.h:1520
bool send_result_metadata(const mem_root_deque< Item * > &list, uint flags)
Send name and type of result to client.
Definition: sql_class.cc:2851
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:1253
bool parsing_system_view
Definition: sql_class.h:2800
Diagnostics_area * m_stmt_da
Definition: sql_class.h:4408
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:1868
const String & rewritten_query() const
Get the rewritten query (with passwords obfuscated etc.) from the THD.
Definition: sql_class.h:4248
void cleanup(void)
Definition: sql_class.cc:1238
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:4290
void inc_status_created_tmp_disk_tables()
Definition: sql_class.cc:2406
const Transaction_ctx * get_transaction() const
Definition: sql_class.h:2119
bool is_connection_admin()
Returns if the user of the session has the CONNECTION_ADMIN privilege or not.
Definition: sql_class.h:4883
mysql::gtid::Tsid owned_tsid
For convenience, this contains the TSID component of the GTID stored in owned_gtid.
Definition: sql_class.h:3779
struct timeval start_time
Definition: sql_class.h:1612
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:1882
const CHARSET_INFO * charset() const
Definition: sql_class.h:3360
void init(void)
Definition: sql_class.cc:1072
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:864
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:3113
void set_status_no_good_index_used()
Definition: sql_class.cc:2502
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:1527
LEX_CSTRING get_invoker_host() const
Definition: sql_class.h:4385
ha_rows get_sent_row_count() const
Definition: sql_class.h:2441
bool charset_is_character_set_filesystem
Definition: sql_class.h:2795
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:1217
bool safe_to_display() const
Definition: sql_class.h:4206
void reset_first_successful_insert_id()
Definition: sql_class.h:2307
void set_time()
Definition: sql_class.cc:3227
bool is_fsp_truncate_mode() const
Definition: sql_class.h:3146
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:1609
Internal_error_handler * m_internal_handler
The current internal error handler for this thread, or NULL.
Definition: sql_class.h:4392
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:3329
void disable_low_level_commit_ordering()
Enables ordering in ha_commit_low.
Definition: sql_class.cc:3027
Plugin_array audit_class_plugins
Array of active audit plugins which have been used by this THD.
Definition: sql_class.h:2861
const NET * get_net() const
Definition: sql_class.h:1937
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:2764
void set_active_vio(Vio *vio)
Definition: sql_class.h:2970
void release_external_store()
Definition: sql_class.cc:3640
uint16 peer_port
Definition: sql_class.h:1611
Secondary_engine_optimization secondary_engine_optimization() const
Can secondary storage engines be used for query execution in this session?
Definition: sql_class.h:4668
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:2634
void set_skip_transaction_read_only_check()
Definition: sql_class.h:1945
uint in_sub_stmt
Definition: sql_class.h:1650
void inc_lock_usec(ulonglong usec)
Definition: sql_class.cc:3240
void disable_mem_cnt()
Definition: sql_class.h:4769
void rollback_item_tree_changes()
Restore locations set by calls to nocheck_register_item_tree_change().
Definition: sql_class.cc:2019
bool se_persists_gtid() const
Definition: sql_class.h:3843
char * m_trans_fixed_log_file
Definition: sql_class.h:1929
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:3032
bool unioned_events_trans
Definition: sql_class.h:2836
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:3983
void increment_con_per_hour_counter()
Definition: sql_class.cc:2652
std::atomic< bool > m_cached_is_connection_alive
Keep a cached value saying whether the connection is alive.
Definition: sql_class.h:1293
uint get_tmp_table_seq_id()
Definition: sql_class.h:4588
const Diagnostics_area * get_stacked_da() const
Returns the second Diagnostics Area for the current statement.
Definition: sql_class.h:3290
void mark_transaction_to_rollback(bool all)
Mark transaction to rollback and mark error as fatal to a sub-statement.
Definition: sql_class.cc:2572
Attachable_trx * m_attachable_trx
Definition: sql_class.h:2114
void raise_warning(uint code)
Raise a completion condition (warning).
Definition: sql_class.cc:956
enum_check_fields check_for_truncated_fields
Definition: sql_class.h:2615
uint get_binlog_table_maps() const
Definition: sql_class.h:1965
PSI_idle_locker * m_idle_psi
Idle instrumentation.
Definition: sql_class.h:2493
Diagnostics_area * get_parser_da()
Returns thread-local Diagnostics Area for parsing.
Definition: sql_class.h:3303
void set_time(const struct timeval *t)
Definition: sql_class.h:3142
collation_unordered_map< std::string, unique_ptr_with_deleter< user_var_entry > > user_vars
Hash for user variables.
Definition: sql_class.h:1144
bool sql_parser()
Call parser to transform statement into a parse tree.
Definition: sql_class.cc:3073
bool rand_used
Definition: sql_class.h:2778
NET net
Definition: sql_class.h:1934
ulonglong m_current_query_partial_plans
Current query partial plans.
Definition: sql_class.h:1170
sp_cache * sp_func_cache
Definition: sql_class.h:2805
Cost_model_server m_cost_model_hypergraph
Definition: sql_class.h:4437
int tx_priority
Definition: sql_class.h:2608
std::unique_ptr< Transaction_ctx > m_transaction
Definition: sql_class.h:1984
table_map table_map_for_update
Definition: sql_class.h:2182
void cleanup_after_parse_error()
Restore session state in case of parse error.
Definition: sql_class.cc:3159
mysql_mutex_t LOCK_thd_sysvar
Protects THD::variables while being updated.
Definition: sql_class.h:1244
ulong ulong_value
Definition: sql_class.h:2814
void update_previous_found_rows()
Definition: sql_class.h:3164
void raise_note(uint code)
Raise a completion condition (note), with a fixed message.
Definition: sql_class.cc:973
void awake(THD::killed_state state_to_set)
Awake a thread.
Definition: sql_class.cc:1516
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:3366
void mark_plugin_fake_ddl(bool flag)
Definition: sql_class.h:4593
mysql_mutex_t LOCK_thd_data
Protects THD data accessed from other threads.
Definition: sql_class.h:1232
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:1774
void restore_globals()
Definition: sql_class.cc:1744
void inc_status_sort_range()
Definition: sql_class.cc:2470
query_id_t first_query_id
Definition: sql_class.h:2842
Ha_data * get_ha_data(int slot)
Retrieve Ha_data for a given slot.
Definition: sql_class.h:1671
Vio * active_vio
Definition: sql_class.h:2134
uint tmp_table_seq_id
Sequential number of internal tmp table created in the statement.
Definition: sql_class.h:4618
MEM_ROOT * user_var_events_alloc
Definition: sql_class.h:2619
THD(bool enable_plugins=true)
Definition: sql_class.cc:629
uint32 unmasked_server_id
Definition: sql_class.h:1607
const char * m_proc_info
Definition: sql_class.h:1487
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:3212
void end_attachable_transaction()
End an active attachable transaction.
Definition: sql_class.cc:2234
bool is_secondary_engine_forced() const
Definition: sql_class.h:4686
const char * proc_info() const
Definition: sql_class.h:1505
bool is_attachable_rw_transaction_active() const
Definition: sql_class.h:3447
void clear_log_reset()
Cleared after flushing SE logs during binlog reset.
Definition: sql_class.h:3822
const st_plugin_int * get_plugin() const
Returns the plugin, the thd belongs to.
Definition: sql_class.h:4581
enum enum_server_command m_command
Type of current query: COM_STMT_PREPARE, COM_QUERY, etc.
Definition: sql_class.h:1598
void reset_db(const LEX_CSTRING &new_db)
Set the current database; use shallow copy of C-string.
Definition: sql_class.h:3971
Se_GTID_flagset m_se_gtid_flags
Flags for SE GTID persistence.
Definition: sql_class.h:3800
Gtid_set * get_gtid_next_list()
Return the value of @gtid_next_list: either a Gtid_set or NULL.
Definition: sql_class.h:3511
mysql_mutex_t LOCK_current_cond
Mutex protecting access to current_mutex and current_cond.
Definition: sql_class.h:1548
void set_secondary_engine_optimization(Secondary_engine_optimization state)
Enables or disables use of secondary storage engines in this session.
Definition: sql_class.h:4660
Transaction_ctx * get_transaction()
Definition: sql_class.h:2117
bool is_initialize_system_thread() const
Definition: sql_class.h:2551
ulong rand_saved_seed1
Definition: sql_class.h:2513
sp_cache * sp_proc_cache
Definition: sql_class.h:2804
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:2162
bool in_active_multi_stmt_transaction() const
true if the session is in a multi-statement transaction mode (
Definition: sql_class.h:3229
void refresh_reference_caches()
Definition: sql_class.h:4803
bool check_clone_vio()
Check if clone network Vio is active.
Definition: sql_class.h:3005
std::unique_ptr< PROFILING > profiling
Definition: sql_class.h:2466
void reset_current_stmt_binlog_format_row()
Definition: sql_class.h:3490
bool m_disable_password_validation
Definition: sql_class.h:1350
bool in_multi_stmt_transaction_mode() const
Returns true if session is in a multi-statement transaction mode.
Definition: sql_class.h:3191
void begin_attachable_ro_transaction()
Start a read-only attachable transaction.
Definition: sql_class.cc:2230
bool do_union
Definition: sql_class.h:2825
const LEX_CSTRING & db() const
Definition: sql_class.h:3937
const Internal_error_handler * get_internal_handler() const
Definition: sql_class.h:4035
ulonglong read_first_successful_insert_id_in_prev_stmt(void)
Definition: sql_class.h:2298
uint32 binlog_unsafe_warning_flags
Bit field for the state of binlog warnings.
Definition: sql_class.h:1902
void raise_error(uint code)
Raise an exception condition.
Definition: sql_class.cc:939
std::atomic< killed_state > killed
Definition: sql_class.h:2721
ulonglong start_utime
Query start time, expressed in microseconds.
Definition: sql_class.h:1617
Security_context * m_security_ctx
Definition: sql_class.h:1322
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:1690
bool unioned_events
Definition: sql_class.h:2830
bool m_is_plugin_fake_ddl
Creating or dropping plugin native table through a plugin service.
Definition: sql_class.h:4611
void set_sent_row_count(ha_rows count)
Definition: sql_class.cc:2391
uint query_name_consts
number of name_const() substitutions, see sp_head.cc:subst_spvars()
Definition: sql_class.h:2808
NET_SERVER m_net_server_extension
Additional network instrumentation for the server only.
Definition: sql_class.h:1135
ulonglong conn_mem_alloc_number
Definition: sql_class.h:4773
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:2499
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:1259
void backup_ha_data(Prealloced_array< Ha_data, PREALLOC_NUM_HA > *backup)
Copy ha_data into the provided argument.
Definition: sql_class.h:1676
uint32 server_id
Definition: sql_class.h:1608
bool is_fatal_error() const
Definition: sql_class.h:3267
Transactional_ddl_context m_transactional_ddl
Definition: sql_class.h:4723
bool duplicate_slave_id
This is only used by master dump threads.
Definition: sql_class.h:4565
bool charset_is_system_charset
is set if a statement accesses a temporary table created through CREATE TEMPORARY TABLE.
Definition: sql_class.h:2794
void reset_rewritten_query()
Reset thd->m_rewritten_query.
Definition: sql_class.h:4258
void release_resources()
Release most resources, prior to THD destruction.
Definition: sql_class.cc:1361
Security_context * security_context() const
Definition: sql_class.h:1324
bool check_event_subscribers(Event_tracking_class event, unsigned long subevent, bool check_audited)
Definition: sql_class.cc:3272
void restore_backup_open_tables_state(Open_tables_backup *backup)
Definition: sql_class.cc:2216
void pop_lock_usec(ulonglong top)
Definition: sql_class.h:1633
void enter_locked_tables_mode(enum_locked_tables_mode mode_arg)
Definition: sql_class.h:4296
bool time_zone_used
Definition: sql_class.h:2778
ulonglong ulonglong_value
Definition: sql_class.h:2815
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:542
uint binlog_table_maps
Definition: sql_class.h:1908
void inc_status_select_range_check()
Definition: sql_class.cc:2446
int send_explain_fields(Query_result *result)
Definition: sql_class.cc:1916
void clear_error()
Clear the current error, if any.
Definition: sql_class.h:3249
bool is_bootstrap_system_thread() const
Definition: sql_class.h:2562
void binlog_invoker()
Definition: sql_class.h:4375
bool is_one_phase_commit()
Definition: sql_class.cc:3103
void set_gtid_persisted_by_se()
Set by SE when it guarantees GTID persistence.
Definition: sql_class.h:3828
void inc_status_sort_merge_passes()
Definition: sql_class.cc:2462
void mark_as_srv_session()
Definition: sql_class.h:4575
MEM_ROOT main_mem_root
This memory root is used for two purposes:
Definition: sql_class.h:4402
struct System_status_var status_var
Definition: sql_class.h:1147
bool m_enable_plugins
Definition: sql_class.h:2874
struct System_status_var * copy_status_var_ptr
Definition: sql_class.h:1148
void clear_owned_gtids()
Definition: sql_class.h:3882
killed_state
Definition: sql_class.h:2714
@ KILL_QUERY
Definition: sql_class.h:2717
@ KILL_CONNECTION
Definition: sql_class.h:2716
@ KILLED_NO_VALUE
Definition: sql_class.h:2719
@ KILL_TIMEOUT
Definition: sql_class.h:2718
@ NOT_KILLED
Definition: sql_class.h:2715
std::vector< char > m_connection_attributes
Session's connection attributes for the connected client.
Definition: sql_class.h:1158
Locked_tables_list locked_tables_list
Definition: sql_class.h:2852
void get_definer(LEX_USER *definer)
Definition: sql_class.cc:2555
const char * m_trans_log_file
The binary log position of the transaction.
Definition: sql_class.h:1928
bool is_commit_in_middle_of_statement
Definition: sql_class.h:3929
Diagnostics_area * get_stmt_da()
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3284
mysql_cond_t COND_group_replication_connection_cond_var
Definition: sql_class.h:4766
std::atomic< bool > m_is_connection_admin
Flag that indicates if the user of current session has CONNECTION_ADMIN privilege.
Definition: sql_class.h:4713
void inc_status_select_full_range_join()
Definition: sql_class.cc:2430
Diagnostics_area m_parser_da
cf.
Definition: sql_class.h:4404
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:1686
const USER_CONN * get_user_connect() const
Definition: sql_class.h:2427
void shutdown_clone_vio()
Shutdown clone vio, if active.
Definition: sql_class.cc:1977
void pin_gtid()
Defer freeing owned GTID and TSID till unpinned.
Definition: sql_class.h:3803
PSI_idle_locker_state m_idle_state
Idle instrumentation state.
Definition: sql_class.h:2496
bool is_plugin_fake_ddl() const
Definition: sql_class.h:4592
bool arg_of_last_insert_id_function
Definition: sql_class.h:2185
void set_skip_readonly_check()
Definition: sql_class.h:1939
Se_GTID_flag
SE GTID persistence flag types.
Definition: sql_class.h:3782
@ SE_GTID_PERSIST_EXPLICIT
Explicit request for SE to persist GTID for current transaction.
Definition: sql_class.h:3792
@ SE_GTID_RESET_LOG
If RESET log in progress.
Definition: sql_class.h:3790
@ SE_GTID_CLEANUP
Cleanup GTID during unpin.
Definition: sql_class.h:3786
@ SE_GTID_PERSIST
SE would persist GTID for current transaction.
Definition: sql_class.h:3788
@ SE_GTID_MAX
Max element holding the biset size.
Definition: sql_class.h:3794
@ SE_GTID_PIN
Pin owned GTID.
Definition: sql_class.h:3784
bool se_persists_gtid_explicit() const
Definition: sql_class.h:3853
bool for_debug_only_is_set_persist_options
Definition: sql_class.h:1247
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:2987
bool release_resources_done() const
Definition: sql_class.cc:1335
bool is_operating_substatement_implicitly
Definition: sql_class.h:2360
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:3255
uint tmp_table
Definition: sql_class.h:2535
union THD::@175 sys_var_tmp
Commit_error
Definition: sql_class.h:2693
@ CE_NONE
Definition: sql_class.h:2694
@ CE_COMMIT_ERROR
Definition: sql_class.h:2698
@ CE_ERROR_COUNT
Definition: sql_class.h:2699
@ CE_SYNC_ERROR
Definition: sql_class.h:2697
@ CE_FLUSH_ERROR
Definition: sql_class.h:2695
@ CE_FLUSH_GNO_EXHAUSTED_ERROR
Definition: sql_class.h:2696
Security_context m_main_security_ctx
Definition: sql_class.h:1321
malloc_unordered_map< std::string, User_level_lock * > ull_hash
Definition: sql_class.h:1539
static const char *const DEFAULT_WHERE
Definition: sql_class.h:1132
void reset_skip_readonly_check()
Definition: sql_class.h:1953
Global_read_lock global_read_lock
Definition: sql_class.h:2132
void inc_sent_row_count(ha_rows count)
Definition: sql_class.cc:2396
bool thread_specific_used
is set if some thread specific value(s) used in a statement.
Definition: sql_class.h:2789
void set_open_tables(TABLE *open_tables_arg)
Assign a new value to open_tables.
Definition: sql_class.h:4280
bool is_cmd_skip_transaction_read_only() const
Definition: sql_class.h:1950
bool owned_gtid_is_empty()
Definition: sql_class.h:3902
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:2051
@ DO_NOT_RESET_LEX
Definition: sql_class.h:2051
@ RESET_LEX
Definition: sql_class.h:2051
uchar password
Definition: sql_class.h:2746
const Cost_model_server * cost_model() const
Retrieve the optimizer cost model for this connection.
Definition: sql_class.cc:3734
void set_proc_info(const char *proc_info)
Definition: sql_class.h:1519
void start_disposal()
Set THD in ACTIVE life stage to disposal stage.
Definition: sql_class.cc:1348
Diagnostics_area * get_query_rewrite_plugin_da()
Returns thread-local Diagnostics Area to be used by query rewrite plugins.
Definition: sql_class.h:3314
bool in_lock_tables
Definition: sql_class.h:2779
sql_digest_state m_digest_state
Top level statement digest.
Definition: sql_class.h:2476
ulonglong found_rows() const
Definition: sql_class.h:3156
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:289
void free_cnt(size_t size)
Decrease memory counter at 'free' operation.
Definition: sql_class.cc:236
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:354
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:251
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:310
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:54
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:3704
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:3654
~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:3672
@ 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:4573
Definition: sql_list.h:711
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:47
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:3021
#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:291
enum_check_fields
Definition: field.h:172
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:9611
bool is_ddl_gtid_compatible()
Definition: binlog.cc:10680
bool is_binlog_cache_empty(bool is_transactional) const
Return true if the statement/transaction cache is currently empty, false otherwise.
Definition: binlog.cc:9354
int binlog_write_row(TABLE *table, bool is_transactional, const uchar *new_data, const unsigned char *extra_row_info)
Definition: binlog.cc:11136
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:9988
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:11161
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:10840
int binlog_delete_row(TABLE *table, bool is_transactional, const uchar *old_data, const unsigned char *extra_row_info)
Definition: binlog.cc:11234
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:10762
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:11548
void add_to_binlog_accessed_dbs(const char *db)
Definition: binlog.cc:9639
void issue_unsafe_warnings()
Auxiliary method used by binlog_query() to raise warnings.
Definition: binlog.cc:11490
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:9566
int binlog_setup_trx_data()
Definition: binlog.cc:9379
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:5157
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:1542
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:138
#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:9173
@ 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:1081
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:1156
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2878
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:93
PSI_memory_key key_memory_user_var_entry
Definition: psi_memory_key.cc:148
PSI_memory_key key_memory_User_level_lock
Definition: psi_memory_key.cc:97
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 string event
Definition: replication_group_member_actions.proto:32
enum_tx_isolation
Definition: handler.h:3186
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:110
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:3890
void my_eof(THD *thd)
A short cut for thd->get_stmt_da()->set_eof_status().
Definition: sql_class.cc:3720
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:4899
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:3048
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:4854
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:3714
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:722
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:131
bool secondary_engine_lock_tables_mode(const THD &cthd)
Return lock_tables_mode for secondary engine.
Definition: sql_class.h:4830
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:231
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:423
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1100
bool is_empty() const
Return true if sidno is zero (and assert that gno is zero too in this case).
Definition: rpl_gtid.h:1125
void clear()
Set both components to 0.
Definition: rpl_gtid.h:1109
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:1209
rpl_sidno sidno
SIDNO of this Gtid.
Definition: rpl_gtid.h:1104
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:3823
Metadata lock object key.
Definition: mdl.h:365
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:45
Per thread status variables.
Definition: system_variables.h:525
ulonglong last_query_partial_plans
Definition: system_variables.h:598
double last_query_cost
Definition: system_variables.h:597
Definition: sql_lexer_thd.h:57
sql_mode_t sql_mode
Definition: sql_lexer_thd.h:58
const CHARSET_INFO * character_set_client
Definition: sql_lexer_thd.h:59
An utility struct for Attachable_trx.
Definition: sql_class.h:1987
bool m_in_lock_tables
THD::in_lock_tables value.
Definition: sql_class.h:2026
void backup(THD *thd)
Definition: sql_class.cc:361
ulonglong m_thd_option_bits
THD options.
Definition: sql_class.h:2017
~Transaction_state()
Definition: sql_class.cc:3056
void restore(THD *thd)
Definition: sql_class.cc:378
PSI_transaction_locker * m_transaction_psi
Current transaction instrumentation.
Definition: sql_class.h:2020
Prealloced_array< Ha_data, PREALLOC_NUM_HA > m_ha_data
Ha_data array.
Definition: sql_class.h:2008
uint m_server_status
Server status flags.
Definition: sql_class.h:2023
bool m_time_zone_used
Current time zone (i.e.
Definition: sql_class.h:2037
bool m_transaction_rollback_request
Transaction rollback request flag.
Definition: sql_class.h:2047
Transaction_ctx * m_trx
Transaction_ctx instance.
Definition: sql_class.h:2011
Open_tables_backup m_open_tables_state
Open-tables state.
Definition: sql_class.h:1999
bool m_tx_read_only
Transaction read-only state.
Definition: sql_class.h:2014
sql_mode_t m_sql_mode
SQL_MODE.
Definition: sql_class.h:2002
Transaction_state()
Definition: sql_class.cc:3052
enum_sql_command m_sql_command
SQL-command.
Definition: sql_class.h:1994
Query_tables_list * m_query_tables_list
Definition: sql_class.h:1996
enum_tx_isolation m_tx_isolation
Transaction isolation level.
Definition: sql_class.h:2005
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:5317
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:2734
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