MySQL 9.1.0
Source Code Documentation
Opt_trace_start Class Reference

#include <opt_trace.h>

Public Member Functions

 Opt_trace_start (THD *thd_arg, Table_ref *tbl, enum enum_sql_command sql_command, List< set_var_base > *set_vars, const char *query, size_t query_length, sp_printable *instr, const CHARSET_INFO *query_charset)
 Instantiate this class to start tracing a THD's actions (generally at a statement's start), and to set the "original" query (not transformed, as sent by client) for the new trace. More...
 
 ~Opt_trace_start ()
 

Private Attributes

Opt_trace_context *const ctx
 
bool error
 whether trace start() had an error More...
 

Constructor & Destructor Documentation

◆ Opt_trace_start()

Opt_trace_start::Opt_trace_start ( THD thd_arg,
Table_ref tbl,
enum enum_sql_command  sql_command,
List< set_var_base > *  set_vars,
const char *  query,
size_t  query_length,
sp_printable instr,
const CHARSET_INFO query_charset 
)

Instantiate this class to start tracing a THD's actions (generally at a statement's start), and to set the "original" query (not transformed, as sent by client) for the new trace.

Destructor will end the trace.

If in a routine's instruction, there is no "query". To be helpful to the user, we craft a query using the instruction's print(). We don't leave this to the caller, because it would be inefficient if tracing is off.

Parameters
thd_argthe THD
tbllist of tables read/written by the statement.
sql_commandSQL command being prepared or executed
set_varswhat variables are set by this command (only used if sql_command is SQLCOM_SET_OPTION)
queryquery
query_lengthquery's length
instrroutine's instruction, if applicable; if so, 'query' and 'query_length' above are ignored
query_charsetcharset which was used to encode this query
Note
Each sub-statement is responsible for ending the trace which it has started; this class achieves this by keeping some memory inside.

◆ ~Opt_trace_start()

Opt_trace_start::~Opt_trace_start ( )

Member Data Documentation

◆ ctx

Opt_trace_context* const Opt_trace_start::ctx
private

◆ error

bool Opt_trace_start::error
private

whether trace start() had an error


The documentation for this class was generated from the following files: