24#ifndef OPT_TRACE_CONTEXT_INCLUDED
25#define OPT_TRACE_CONTEXT_INCLUDED
134 bool end_marker,
bool one_line,
long offset,
long limit,
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
To have the smallest impact on THD's size, most of the implementation is moved to a separate class Op...
Definition: opt_trace_context.h:298
Opt_trace_stmt_array stack_of_current_stmts
To keep track of what is the current statement, as execution goes into a sub-statement,...
Definition: opt_trace_context.h:352
Opt_trace_stmt_array all_stmts_to_del
List of traces which are unneeded because of OFFSET/LIMIT, and scheduled for deletion from memory.
Definition: opt_trace_context.h:368
size_t max_mem_size
Definition: opt_trace_context.h:375
long since_offset_0
Number of statements traced so far since "offset 0", for comparison with OFFSET and LIMIT,...
Definition: opt_trace_context.h:381
void restore_I_S()
Definition: opt_trace.cc:1125
void disable_I_S_for_this_and_children()
Definition: opt_trace.cc:1121
long offset
Definition: opt_trace_context.h:373
Opt_trace_context_impl()
Definition: opt_trace_context.h:300
bool end_marker
copy of parameter of Opt_trace_context::start
Definition: opt_trace_context.h:370
Opt_trace_stmt * current_stmt_in_gen
Definition: opt_trace_context.h:341
feature_value features
Definition: opt_trace_context.h:372
long limit
Definition: opt_trace_context.h:374
Opt_trace_stmt_array all_stmts_for_I_S
List of remembered traces for putting into the OPTIMIZER_TRACE table.
Definition: opt_trace_context.h:363
bool one_line
Definition: opt_trace_context.h:371
UnstructuredTrace * m_unstructured_trace
Trace in plain text, as used by Hypergraph.
Definition: opt_trace_context.h:384
A per-session context which is always available at any point of execution, because in practice it's a...
Definition: opt_trace_context.h:94
bool get_end_marker() const
Definition: opt_trace_context.h:176
bool get_one_line() const
Definition: opt_trace_context.h:178
bool start(bool support_I_S, bool support_dbug_or_missing_priv, bool end_marker, bool one_line, long offset, long limit, ulong max_mem_size, ulonglong features)
Starts a new trace.
Definition: opt_trace.cc:831
@ FLAG_ONE_LINE
Definition: opt_trace_context.h:189
@ FLAG_ENABLED
Definition: opt_trace_context.h:189
@ FLAG_DEFAULT
Definition: opt_trace_context.h:189
void purge_stmts(bool purge_all)
Find and delete unneeded traces.
Definition: opt_trace.cc:1004
void set_unstructured_trace(UnstructuredTrace *trace)
Definition: opt_trace_context.h:280
void disable_I_S_for_this_and_children()
Temporarily disables I_S for this trace and its children.
Definition: opt_trace_context.h:261
void set_query(const char *query, size_t length, const CHARSET_INFO *charset)
Set the "original" query (not transformed, as sent by client) for the current trace.
Definition: opt_trace.cc:1109
Opt_trace_stmt * get_current_stmt_in_gen()
Opt_trace_struct is passed Opt_trace_context*, and needs to know to which statement's trace to attach...
Definition: opt_trace_context.h:248
UnstructuredTrace * unstructured_trace()
Definition: opt_trace_context.h:276
const Opt_trace_stmt * get_next_stmt_for_I_S(long *got_so_far) const
Definition: opt_trace.cc:1171
feature_value
Features' numeric values for @@optimizer_trace_features variable.
Definition: opt_trace_context.h:205
@ REPEATED_SUBSELECT
Definition: opt_trace_context.h:209
@ RANGE_OPTIMIZER
Definition: opt_trace_context.h:207
@ MISC
Anything unclassified, including the top object (thus, by "inheritance from parent",...
Definition: opt_trace_context.h:220
@ GREEDY_SEARCH
Definition: opt_trace_context.h:206
@ DYNAMIC_RANGE
Definition: opt_trace_context.h:208
~Opt_trace_context()
Definition: opt_trace.cc:804
void reset()
Brainwash: deletes all remembered traces and resets counters regarding OFFSET/LIMIT (so that the next...
Definition: opt_trace.cc:1114
size_t allowed_mem_size_for_current_stmt() const
Compute maximum allowed memory size for current trace.
Definition: opt_trace.cc:1088
static const char * flag_names[]
Names of flags for @@optimizer_trace variable of sys_vars.cc :
Definition: opt_trace_context.h:186
bool support_I_S() const
Definition: opt_trace.cc:999
int I_S_disabled
Dynamically allocated implementation.
Definition: opt_trace_context.h:394
Opt_trace_context()
Definition: opt_trace_context.h:96
bool is_started() const
Returns whether there is a current trace.
Definition: opt_trace_context.h:148
void missing_privilege()
User lacks privileges to see the current trace.
Definition: opt_trace.cc:1155
static const char * feature_names[]
Features' names for @@optimizer_trace_features variable of sys_vars.cc:
Definition: opt_trace_context.h:202
void ConsumeUnstructuredTrace(THD *thd)
Move unstructured trace text (as produced by Hypergraph) into the JSON tree.
Definition: opt_trace.cc:1130
static const feature_value default_features
Optimizer features which are traced by default.
Definition: opt_trace_context.h:233
void restore_I_S()
Restores I_S support to what it was before the previous call to disable_I_S_for_this_and_children().
Definition: opt_trace_context.h:270
Opt_trace_context & operator=(const Opt_trace_context &)
Not defined assignment operator, to disallow assignment.
Opt_trace_context_impl * pimpl
Definition: opt_trace_context.h:387
void end()
Ends the current (=open, unfinished, being-generated) trace.
Definition: opt_trace.cc:957
Opt_trace_context(const Opt_trace_context &)
Not defined copy constructor, to disallow copy.
bool feature_enabled(feature_value f) const
Definition: opt_trace_context.h:239
The trace of one statement.
Definition: opt_trace.cc:113
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Trace in the form of plain text (i.e.
Definition: optimizer_trace.h:146
static constexpr unsigned PSI_INSTRUMENT_ME
Definition: psi_bits.h:43
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:58
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
static char * query
Definition: myisam_ftdump.cc:47
const std::string charset("charset")
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
Prealloced_array< Opt_trace_stmt *, 16 > Opt_trace_stmt_array
Definition: opt_trace_context.h:44
Performance schema instrumentation interface.
Definition: m_ctype.h:421