128#ifdef HAVE_PSI_INTERFACE
475 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
517#ifdef HAVE_PSI_INTERFACE
534 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, is_lex_owner),
579#ifdef HAVE_PSI_INTERFACE
597 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
638#ifdef HAVE_PSI_INTERFACE
655 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
711#ifdef HAVE_PSI_INTERFACE
781#ifdef HAVE_PSI_INTERFACE
892 expr_item, expr_query) {}
897 expr_item, expr_query, dest) {}
917#ifdef HAVE_PSI_INTERFACE
938 case_expr_item, case_expr_query),
994#ifdef HAVE_PSI_INTERFACE
1016 when_expr_item, when_expr_query),
1074#ifdef HAVE_PSI_INTERFACE
1136#ifdef HAVE_PSI_INTERFACE
1164#ifdef HAVE_PSI_INTERFACE
1200#ifdef HAVE_PSI_INTERFACE
1286#ifdef HAVE_PSI_INTERFACE
1320#ifdef HAVE_PSI_INTERFACE
1355#ifdef HAVE_PSI_INTERFACE
1391#ifdef HAVE_PSI_INTERFACE
1432#ifdef HAVE_PSI_INTERFACE
1478#ifdef HAVE_PSI_INTERFACE
static app_data_list nextp(app_data_list l)
Return next element in list of app_data.
Definition: app_data.cc:301
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
void reset_condition_info(THD *thd)
Reset the current condition information stored in the Diagnostics Area.
Definition: sql_error.cc:491
void reset_diagnostics_area()
Clear this Diagnostics Area.
Definition: sql_error.cc:361
Represents NEW/OLD version of field of row which is changed/read in trigger.
Definition: item.h:6699
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Definition: sql_list.h:494
Definition: sql_class.h:348
void free_items()
Definition: sql_class.cc:2087
enum_sql_command sql_command
SQL command for this statement.
Definition: sql_lex.h:2628
Simple intrusive linked list.
Definition: sql_list.h:48
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
bool append(const String &s)
Definition: sql_string.cc:419
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
LEX * lex
Definition: sql_class.h:1001
Diagnostics_area * get_stmt_da()
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3308
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4583
An interface for all SP-instructions with destinations that need to be updated by the SP-optimizer.
Definition: sp_instr.h:78
virtual void backpatch(uint dest)=0
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
virtual ~sp_branch_instr()=default
virtual void set_destination(uint old_dest, uint new_dest)=0
Update the destination; used by the SP-instruction-optimizer.
This class represents condition-value term in DECLARE CONDITION or DECLARE HANDLER statements.
Definition: sp_pcontext.h:133
This class represents 'DECLARE HANDLER' statement.
Definition: sp_pcontext.h:193
sp_head represents one instance of a stored program.
Definition: sp_head.h:383
The instruction corresponds to the CLOSE statement.
Definition: sp_instr.h:1370
static PSI_statement_info psi_info
Definition: sp_instr.h:1395
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1765
sp_instr_cclose(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1372
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1389
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1776
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1393
The instruction corresponds to the FETCH statement.
Definition: sp_instr.h:1406
List< sp_variable > m_varlist
List of SP-variables to store fetched values.
Definition: sp_instr.h:1427
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1434
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1802
sp_instr_cfetch(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1408
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1813
static PSI_statement_info psi_info
Definition: sp_instr.h:1436
void add_to_varlist(sp_variable *var)
Definition: sp_instr.h:1423
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1430
sp_instr_copen represents OPEN statement (opens the cursor).
Definition: sp_instr.h:1334
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1698
sp_instr_copen(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1336
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1739
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1357
static PSI_statement_info psi_info
Definition: sp_instr.h:1359
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1353
sp_instr_cpop instruction is added at the end of BEGIN..END block.
Definition: sp_instr.h:1300
uint m_count
Definition: sp_instr.h:1318
static PSI_statement_info psi_info
Definition: sp_instr.h:1324
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1322
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1681
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1674
sp_instr_cpop(uint ip, sp_pcontext *ctx, uint count)
Definition: sp_instr.h:1302
sp_instr_cpush corresponds to DECLARE CURSOR, implements DECLARE CURSOR and OPEN.
Definition: sp_instr.h:1229
bool is_invalid() const override
Definition: sp_instr.h:1262
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:1270
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1264
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1288
static PSI_statement_info psi_info
Definition: sp_instr.h:1290
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1284
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1629
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:1266
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1646
LEX_CSTRING m_cursor_query
This attribute keeps the cursor SELECT statement.
Definition: sp_instr.h:1277
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1637
bool m_valid
Flag if the LEX-object of this instruction is valid or not.
Definition: sp_instr.h:1281
sp_instr_cpush(uint ip, sp_pcontext *ctx, LEX *cursor_lex, LEX_CSTRING cursor_query, int cursor_idx)
Definition: sp_instr.h:1231
sp_instr_error just throws an SQL-condition if the execution flow comes to it.
Definition: sp_instr.h:1448
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:1463
sp_instr_error(uint ip, sp_pcontext *ctx, int errcode)
Definition: sp_instr.h:1450
int m_errcode
The error code, which should be raised by this instruction.
Definition: sp_instr.h:1476
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1480
uint opt_mark(sp_head *, List< sp_instr > *) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.h:1469
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1848
static PSI_statement_info psi_info
Definition: sp_instr.h:1482
sp_instr_freturn represents RETURN statement in stored functions.
Definition: sp_instr.h:651
LEX_CSTRING m_expr_query
SQL-query corresponding to the RETURN-expression.
Definition: sp_instr.h:706
static PSI_statement_info psi_info
Definition: sp_instr.h:715
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:683
Item * m_expr_item
RETURN-expression item.
Definition: sp_instr.h:703
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1433
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:694
enum enum_field_types m_return_field_type
RETURN-field type code.
Definition: sp_instr.h:709
sp_instr_freturn(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, enum enum_field_types return_field_type)
Definition: sp_instr.h:653
bool on_after_expr_parsing(THD *thd) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:688
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:713
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1452
bool is_invalid() const override
Definition: sp_instr.h:681
void adjust_sql_command(LEX *lex) override
Some expressions may be re-parsed as SELECT statements, but need to be adjusted to another SQL comman...
Definition: sp_instr.h:696
uint opt_mark(sp_head *, List< sp_instr > *) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.h:670
Definition: sp_instr.h:1146
void print(const THD *, String *str) override
Definition: sp_instr.h:1154
static PSI_statement_info psi_info
Definition: sp_instr.h:1168
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1166
sp_instr_hpop(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:1148
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1548
Definition: sp_instr.h:1086
sp_instr_hpush_jump(uint ip, sp_pcontext *ctx, sp_handler *handler)
Definition: sp_instr.cc:1472
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1496
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1111
uint m_opt_hpop
hpop marking end of handler scope.
Definition: sp_instr.h:1130
sp_handler * m_handler
Handler.
Definition: sp_instr.h:1127
void backpatch(uint dest) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:1117
~sp_instr_hpush_jump() override
Definition: sp_instr.cc:1481
uint m_frame
Definition: sp_instr.h:1134
static PSI_statement_info psi_info
Definition: sp_instr.h:1140
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1490
uint opt_mark(sp_head *sp, List< sp_instr > *leads) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.cc:1508
void add_condition(sp_condition_value *condition_value)
Definition: sp_instr.cc:1486
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1138
sp_handler * get_handler()
Definition: sp_instr.h:1094
Definition: sp_instr.h:1174
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1202
uint m_frame
Definition: sp_instr.h:1198
static PSI_statement_info psi_info
Definition: sp_instr.h:1204
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1191
uint opt_mark(sp_head *sp, List< sp_instr > *leads) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.cc:1602
sp_instr_hreturn(uint ip, sp_pcontext *ctx)
Definition: sp_instr.cc:1564
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1567
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1588
sp_instr_jump_case_when instruction is used in the "simple CASE" implementation.
Definition: sp_instr.h:1011
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1373
int m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:1062
static PSI_statement_info psi_info
Definition: sp_instr.h:1078
Item_case_expr * m_case_expr_item
Item representing the CASE-expression.
Definition: sp_instr.h:1065
bool on_after_expr_parsing(THD *thd) override
Build CASE-expression item tree: Item_func_eq(case-expression, when-i-expression)
Definition: sp_instr.cc:1386
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1031
Item * m_eq_item
Item corresponding to the main item of the jump-condition-expression: it's the equal function (=) in ...
Definition: sp_instr.h:1072
sp_instr_jump_case_when(uint ip, LEX *lex, int case_expr_id, Item *when_expr_item, LEX_CSTRING when_expr_query)
Definition: sp_instr.h:1013
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1076
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1361
sp_instr_jump_if_not implements SP-instruction, which does the jump if its SQL-expression is false.
Definition: sp_instr.h:887
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:889
bool on_after_expr_parsing(THD *thd) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:911
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1290
static PSI_statement_info psi_info
Definition: sp_instr.h:921
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:894
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:919
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1278
This is base class for all kinds of jump instructions.
Definition: sp_instr.h:731
sp_instr_jump(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:733
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:783
sp_instr * m_optdest
Definition: sp_instr.h:779
sp_instr_jump(uint ip, sp_pcontext *ctx, uint dest)
Definition: sp_instr.h:736
uint opt_mark(sp_head *sp, List< sp_instr > *leads) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.cc:1237
uint m_dest
Where we will go.
Definition: sp_instr.h:776
void backpatch(uint dest) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:768
static PSI_statement_info psi_info
Definition: sp_instr.h:785
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1230
void opt_move(uint dst, List< sp_branch_instr > *ibp) override
Inform the instruction that it has been moved during optimization.
Definition: sp_instr.cc:1260
uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
Short-cut jumps to jumps during optimization.
Definition: sp_instr.cc:1245
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:749
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:764
sp_instr_set_case_expr is used in the "simple CASE" implementation to evaluate and store the CASE-exp...
Definition: sp_instr.h:933
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:972
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1888
void opt_move(uint dst, List< sp_branch_instr > *ibp) override
Inform the instruction that it has been moved during optimization.
Definition: sp_instr.cc:1914
static PSI_statement_info psi_info
Definition: sp_instr.h:998
uint m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:992
bool on_after_expr_parsing(THD *thd) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:984
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:996
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1865
sp_instr_set_case_expr(uint ip, LEX *lex, uint case_expr_id, Item *case_expr_item, LEX_CSTRING case_expr_query)
Definition: sp_instr.h:935
uint opt_mark(sp_head *sp, List< sp_instr > *leads) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.cc:1900
void backpatch(uint) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:976
sp_instr_set_trigger_field represents SET-statements, which deal with NEW/OLD trigger pseudo-rows.
Definition: sp_instr.h:592
sp_instr_set_trigger_field(uint ip, LEX *lex, LEX_CSTRING trigger_field_name, Item_trigger_field *trigger_field, Item *value_item, LEX_CSTRING value_query)
Definition: sp_instr.h:594
bool on_after_expr_parsing(THD *thd) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.cc:1194
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:640
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1168
bool is_invalid() const override
Definition: sp_instr.h:615
static PSI_statement_info psi_info
Definition: sp_instr.h:642
Item_trigger_field * m_trigger_field
Item corresponding to the NEW/OLD trigger field.
Definition: sp_instr.h:630
void cleanup_before_parsing(THD *thd) override
Destroy items in the free list before re-parsing the statement query string (and thus,...
Definition: sp_instr.cc:1214
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1187
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:617
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:623
LEX_CSTRING m_trigger_field_name
Trigger field name ("field_name" of the "NEW.field_name").
Definition: sp_instr.h:627
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:636
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:633
sp_instr_set represents SET-statements, which deal with SP-variables.
Definition: sp_instr.h:530
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:562
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:577
bool on_after_expr_parsing(THD *thd) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:555
void adjust_sql_command(LEX *lex) override
Some expressions may be re-parsed as SELECT statements, but need to be adjusted to another SQL comman...
Definition: sp_instr.h:564
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1123
sp_instr_set(uint ip, LEX *lex, uint offset, Item *value_item, LEX_CSTRING value_query, bool is_lex_owner)
Definition: sp_instr.h:532
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1140
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:553
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:574
bool is_invalid() const override
Definition: sp_instr.h:551
static PSI_statement_info psi_info
Definition: sp_instr.h:581
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:582
uint m_offset
Frame offset.
Definition: sp_instr.h:571
sp_instr_stmt represents almost all conventional SQL-statements, which are supported outside stored p...
Definition: sp_instr.h:472
bool is_invalid() const override
Definition: sp_instr.h:497
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:499
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1069
sp_instr_stmt(uint ip, LEX *lex, LEX_CSTRING query)
Definition: sp_instr.h:474
static PSI_statement_info psi_info
Definition: sp_instr.h:521
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:505
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1093
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:965
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:519
bool m_valid
Specify if the stored LEX-object is up-to-date.
Definition: sp_instr.h:515
LEX_CSTRING m_query
Complete query of the SQL-statement.
Definition: sp_instr.h:512
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:501
Base class for every SP-instruction.
Definition: sp_instr.h:105
bool m_marked
Show if this instruction is reachable within the SP (used by SP-optimizer).
Definition: sp_instr.h:199
virtual SQL_I_List< Item_trigger_field > * get_instr_trig_field_list()
Definition: sp_instr.h:190
sp_instr(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:107
sp_pcontext * m_parsing_ctx
Instruction parsing context.
Definition: sp_instr.h:205
void clear_da(THD *thd) const
Clear diagnostics area.
Definition: sp_instr.h:148
virtual uint opt_shortcut_jump(sp_head *, sp_instr *start)
Short-cut jumps to jumps during optimization.
Definition: sp_instr.h:174
bool opt_is_marked() const
Definition: sp_instr.h:188
virtual uint get_cont_dest() const
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:139
virtual uint opt_mark(sp_head *, List< sp_instr > *leads)
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.h:163
void operator=(sp_instr &)
sp_instr(const sp_instr &)
virtual bool execute(THD *thd, uint *nextp)=0
Execute this instruction.
virtual void opt_move(uint dst, List< sp_branch_instr > *ibp)
Inform the instruction that it has been moved during optimization.
Definition: sp_instr.h:184
uint m_ip
Instruction pointer.
Definition: sp_instr.h:202
Query_arena m_arena
Definition: sp_instr.h:194
uint get_ip() const
Definition: sp_instr.h:132
virtual PSI_statement_info * get_psi_info()=0
~sp_instr() override
Definition: sp_instr.h:113
sp_pcontext * get_parsing_ctx() const
Definition: sp_instr.h:141
sp_lex_branch_instr is a base class for SP-instructions, which might perform conditional jump dependi...
Definition: sp_instr.h:795
sp_instr * m_cont_optdest
Definition: sp_instr.h:872
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:807
uint m_dest
Where we will go.
Definition: sp_instr.h:865
void opt_move(uint dst, List< sp_branch_instr > *ibp) override
Inform the instruction that it has been moved during optimization.
Definition: sp_instr.cc:1331
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:797
uint m_cont_dest
Where continue handlers will go.
Definition: sp_instr.h:868
bool is_invalid() const override
Definition: sp_instr.h:834
sp_instr * m_optdest
Definition: sp_instr.h:871
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:846
uint opt_mark(sp_head *sp, List< sp_instr > *leads) override
Mark this instruction as reachable during optimization and return the index to the next instruction.
Definition: sp_instr.cc:1307
LEX_CSTRING m_expr_query
SQL-query corresponding to the expression.
Definition: sp_instr.h:878
void adjust_sql_command(LEX *lex) override
Some expressions may be re-parsed as SELECT statements, but need to be adjusted to another SQL comman...
Definition: sp_instr.h:858
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:840
Item * m_expr_item
Expression item.
Definition: sp_instr.h:875
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:836
void backpatch(uint dest) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:852
uint get_cont_dest() const override
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:828
void set_cont_dest(uint cont_dest)
Definition: sp_instr.h:818
sp_lex_instr is a class providing the interface and base implementation for SP-instructions,...
Definition: sp_instr.h:224
bool execute_expression(THD *thd, uint *nextp)
Execute an expression (e.g an IF) that is not a complete SQL statement.
Definition: sp_instr.cc:319
bool reset_lex_and_exec_core(THD *thd, uint *nextp, bool open_tables)
Prepare LEX and thread for execution of instruction, if requested open and lock LEX's tables,...
Definition: sp_instr.cc:388
~sp_lex_instr() override
Definition: sp_instr.h:236
Table_ref ** m_lex_query_tables_own_last
The value m_lex->query_tables_own_last should be set to this when the statement enters/leaves prelock...
Definition: sp_instr.h:455
void set_lex(LEX *lex, bool is_lex_owner)
Set LEX-object.
Definition: sp_instr.cc:905
virtual LEX_CSTRING get_expr_query() const
Definition: sp_instr.h:391
virtual bool is_invalid() const =0
Table_ref * m_prelocking_tables
List of additional tables this statement needs to lock when it enters/leaves prelocked mode on its ow...
Definition: sp_instr.h:449
LEX * m_lex
LEX-object.
Definition: sp_instr.h:416
virtual void get_query(String *sql_query) const
Return the query string, which can be passed to the parser.
Definition: sp_instr.cc:944
SQL_I_List< Item_trigger_field > * get_instr_trig_field_list() override
Definition: sp_instr.h:267
virtual void adjust_sql_command(LEX *)
Some expressions may be re-parsed as SELECT statements, but need to be adjusted to another SQL comman...
Definition: sp_instr.h:379
SQL_I_List< Item_trigger_field > m_trig_field_list
List of all the Item_trigger_field's of instruction.
Definition: sp_instr.h:460
bool validate_lex_and_execute_core(THD *thd, uint *nextp, bool open_tables)
Make a few attempts to execute the instruction.
Definition: sp_instr.cc:711
void free_lex()
Cleanup and destroy assigned LEX-object if needed.
Definition: sp_instr.cc:915
bool m_is_lex_owner
Indicates whether this sp_lex_instr instance is responsible for LEX-object deletion.
Definition: sp_instr.h:430
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:326
virtual bool exec_core(THD *thd, uint *nextp)=0
Execute core function of instruction after all preparations (e.g.
bool m_first_execution
Indicates whether exec_core() has not been already called on the current LEX-object.
Definition: sp_instr.h:436
virtual bool on_after_expr_parsing(THD *thd)
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:403
virtual void invalidate()=0
Invalidate the object.
virtual void cleanup_before_parsing(THD *thd)
Destroy items in the free list before re-parsing the statement query string (and thus,...
Definition: sp_instr.cc:931
sp_lex_instr(uint ip, sp_pcontext *ctx, LEX *lex, bool is_lex_owner)
Definition: sp_instr.h:226
MEM_ROOT m_lex_mem_root
Mem-root for storing the LEX-tree during reparse.
Definition: sp_instr.h:424
LEX * parse_statement(THD *thd, sp_head *sp)
Parse statement corresponding to this instruction and return a new LEX.
Definition: sp_instr.cc:573
The class represents parse-time context, which keeps track of declared variables/parameters,...
Definition: sp_pcontext.h:252
sp_printable defines an interface which should be implemented if a class wants report some internal i...
Definition: sp_instr.h:67
virtual void print(const THD *thd, String *str)=0
virtual ~sp_printable()=default
This class represents a stored program variable or a parameter (also referenced as 'SP-variable').
Definition: sp_pcontext.h:49
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
bool open_tables(THD *thd, Table_ref **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy)
Open all tables in list.
Definition: sql_base.cc:5891
#define alloc_root_inited(A)
Definition: my_sys.h:800
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
Item * single_visible_field() const
Definition: sql_resolver.cc:4868
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:48
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Header for compiler-dependent features.
Some integer typedefs for easier portability.
#define MYF(v)
Definition: my_inttypes.h:97
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
@ SQLCOM_SELECT
Definition: my_sqlcommand.h:47
@ SQLCOM_END
Definition: my_sqlcommand.h:208
@ SQLCOM_SET_OPTION
Definition: my_sqlcommand.h:78
Common header for many mysys elements.
static int count
Definition: myisam_ftdump.cc:45
static char * query
Definition: myisam_ftdump.cc:47
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
Performance schema instrumentation interface.
File containing constants that can be used throughout the server.
constexpr const size_t MEM_ROOT_BLOCK_SIZE
Memory allocated when parsing a statement.
Definition: sql_const.h:129
Our own string classes, used pervasively throughout the executor.
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:29
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3844
bool safe_to_cache_query
Whether this query will return the same answer every time, given unchanged data.
Definition: sql_lex.h:4225
Query_block * query_block
First query block.
Definition: sql_lex.h:3849
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
size_t length
Definition: mysql_lex_string.h:42
Statement instrument information.
Definition: psi_statement_bits.h:133
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:44