MySQL 8.3.0
Source Code Documentation
sp_instr.cc File Reference
#include "sql/sp_instr.h"
#include "my_config.h"
#include <algorithm>
#include <atomic>
#include <functional>
#include <memory>
#include "debug_sync.h"
#include "my_command.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_sqlcommand.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/plugin.h"
#include "mysql/psi/mysql_statement.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "prealloced_array.h"
#include "scope_guard.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/binlog.h"
#include "sql/enum_query_type.h"
#include "sql/error_handler.h"
#include "sql/field.h"
#include "sql/item.h"
#include "sql/item_cmpfunc.h"
#include "sql/log.h"
#include "sql/mdl.h"
#include "sql/mysqld.h"
#include "sql/opt_trace.h"
#include "sql/protocol.h"
#include "sql/query_options.h"
#include "sql/session_tracker.h"
#include "sql/sp.h"
#include "sql/sp_head.h"
#include "sql/sp_pcontext.h"
#include "sql/sp_rcontext.h"
#include "sql/sql_base.h"
#include "sql/sql_const.h"
#include "sql/sql_digest_stream.h"
#include "sql/sql_parse.h"
#include "sql/sql_prepare.h"
#include "sql/sql_profile.h"
#include "sql/system_variables.h"
#include "sql/table_trigger_dispatcher.h"
#include "sql/thr_malloc.h"
#include "sql/transaction.h"
#include "sql/transaction_info.h"
#include "sql/trigger.h"
#include "sql/trigger_def.h"
#include "string_with_len.h"
#include "unsafe_string_append.h"

Classes

class  Cmp_splocal_locations
 
class  SP_instr_error_handler
 

Macros

#define SP_INSTR_UINT_MAXLEN   8
 
#define SP_STMT_PRINT_MAXLEN   40
 

Functions

static bool subst_spvars (THD *thd, sp_instr *instr, LEX_CSTRING query_str)
 Replace thd->query{_length} with a string that one can write to the binlog. More...
 

Macro Definition Documentation

◆ SP_INSTR_UINT_MAXLEN

#define SP_INSTR_UINT_MAXLEN   8

◆ SP_STMT_PRINT_MAXLEN

#define SP_STMT_PRINT_MAXLEN   40

Function Documentation

◆ subst_spvars()

static bool subst_spvars ( THD thd,
sp_instr instr,
LEX_CSTRING  query_str 
)
static

Replace thd->query{_length} with a string that one can write to the binlog.

The binlog-suitable string is produced by replacing references to SP local variables with NAME_CONST('sp_var_name', value) calls.

Parameters
thdCurrent thread.
instrInstruction (we look for Item_splocal instances in instr->item_list)
query_strOriginal query string
Return values
falseon success. thd->query{_length} either has been appropriately replaced or there is no need for replacements.
truein case of out of memory error.