24#ifndef OPT_TRACE_CONTEXT_INCLUDED
25#define OPT_TRACE_CONTEXT_INCLUDED
133 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:293
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:347
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:363
size_t max_mem_size
Definition: opt_trace_context.h:370
long since_offset_0
Number of statements traced so far since "offset 0", for comparison with OFFSET and LIMIT,...
Definition: opt_trace_context.h:376
void restore_I_S()
Definition: opt_trace.cc:1115
void disable_I_S_for_this_and_children()
Definition: opt_trace.cc:1111
long offset
Definition: opt_trace_context.h:368
Opt_trace_context_impl()
Definition: opt_trace_context.h:295
bool end_marker
copy of parameter of Opt_trace_context::start
Definition: opt_trace_context.h:365
Opt_trace_stmt * current_stmt_in_gen
Definition: opt_trace_context.h:336
feature_value features
Definition: opt_trace_context.h:367
long limit
Definition: opt_trace_context.h:369
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:358
bool one_line
Definition: opt_trace_context.h:366
UnstructuredTrace * m_unstructured_trace
Trace in plain text, as used by Hypergraph.
Definition: opt_trace_context.h:379
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
bool get_end_marker() const
Definition: opt_trace_context.h:175
bool get_one_line() const
Definition: opt_trace_context.h:177
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:821
void purge_stmts(bool purge_all)
Find and delete unneeded traces.
Definition: opt_trace.cc:994
void set_unstructured_trace(UnstructuredTrace *trace)
Definition: opt_trace_context.h:279
void disable_I_S_for_this_and_children()
Temporarily disables I_S for this trace and its children.
Definition: opt_trace_context.h:260
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:1099
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:247
UnstructuredTrace * unstructured_trace()
Definition: opt_trace_context.h:275
const Opt_trace_stmt * get_next_stmt_for_I_S(long *got_so_far) const
Definition: opt_trace.cc:1135
feature_value
Features' numeric values for @@optimizer_trace_features variable.
Definition: opt_trace_context.h:204
@ REPEATED_SUBSELECT
Definition: opt_trace_context.h:208
@ RANGE_OPTIMIZER
Definition: opt_trace_context.h:206
@ MISC
Anything unclassified, including the top object (thus, by "inheritance from parent",...
Definition: opt_trace_context.h:219
@ GREEDY_SEARCH
Definition: opt_trace_context.h:205
@ DYNAMIC_RANGE
Definition: opt_trace_context.h:207
~Opt_trace_context()
Definition: opt_trace.cc:794
void reset()
Brainwash: deletes all remembered traces and resets counters regarding OFFSET/LIMIT (so that the next...
Definition: opt_trace.cc:1104
size_t allowed_mem_size_for_current_stmt() const
Compute maximum allowed memory size for current trace.
Definition: opt_trace.cc:1078
static const char * flag_names[]
Names of flags for @@optimizer_trace variable of sys_vars.cc :
Definition: opt_trace_context.h:185
bool support_I_S() const
Definition: opt_trace.cc:989
int I_S_disabled
Dynamically allocated implementation.
Definition: opt_trace_context.h:389
Opt_trace_context()
Definition: opt_trace_context.h:95
bool is_started() const
Returns whether there is a current trace.
Definition: opt_trace_context.h:147
void missing_privilege()
User lacks privileges to see the current trace.
Definition: opt_trace.cc:1119
static const char * feature_names[]
Features' names for @@optimizer_trace_features variable of sys_vars.cc:
Definition: opt_trace_context.h:201
static const feature_value default_features
Optimizer features which are traced by default.
Definition: opt_trace_context.h:232
@ FLAG_ONE_LINE
Definition: opt_trace_context.h:188
@ FLAG_ENABLED
Definition: opt_trace_context.h:188
@ FLAG_DEFAULT
Definition: opt_trace_context.h:188
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:269
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:382
void end()
Ends the current (=open, unfinished, being-generated) trace.
Definition: opt_trace.cc:947
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:238
The trace of one statement.
Definition: opt_trace.cc:111
Trace in the form of plain text (i.e.
Definition: optimizer_trace.h:124
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:43
Performance schema instrumentation interface.
Definition: m_ctype.h:423