128#ifdef HAVE_PSI_INTERFACE
476 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
518#ifdef HAVE_PSI_INTERFACE
535 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, is_lex_owner),
580#ifdef HAVE_PSI_INTERFACE
598 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
639#ifdef HAVE_PSI_INTERFACE
656 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
712#ifdef HAVE_PSI_INTERFACE
782#ifdef HAVE_PSI_INTERFACE
893 expr_item, expr_query) {}
898 expr_item, expr_query, dest) {}
918#ifdef HAVE_PSI_INTERFACE
939 case_expr_item, case_expr_query),
995#ifdef HAVE_PSI_INTERFACE
1017 when_expr_item, when_expr_query),
1075#ifdef HAVE_PSI_INTERFACE
1137#ifdef HAVE_PSI_INTERFACE
1165#ifdef HAVE_PSI_INTERFACE
1201#ifdef HAVE_PSI_INTERFACE
1287#ifdef HAVE_PSI_INTERFACE
1321#ifdef HAVE_PSI_INTERFACE
1356#ifdef HAVE_PSI_INTERFACE
1392#ifdef HAVE_PSI_INTERFACE
1433#ifdef HAVE_PSI_INTERFACE
1479#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:6756
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Definition: sql_list.h:467
Definition: sql_class.h:348
void free_items()
Definition: sql_class.cc:2041
enum_sql_command sql_command
SQL command for this statement.
Definition: sql_lex.h:2607
Simple intrusive linked list.
Definition: sql_list.h:47
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:3302
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4571
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:1371
static PSI_statement_info psi_info
Definition: sp_instr.h:1396
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1732
sp_instr_cclose(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1373
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1390
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1743
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1394
The instruction corresponds to the FETCH statement.
Definition: sp_instr.h:1407
List< sp_variable > m_varlist
List of SP-variables to store fetched values.
Definition: sp_instr.h:1428
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1435
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1769
sp_instr_cfetch(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1409
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1780
static PSI_statement_info psi_info
Definition: sp_instr.h:1437
void add_to_varlist(sp_variable *var)
Definition: sp_instr.h:1424
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1431
sp_instr_copen represents OPEN statement (opens the cursor).
Definition: sp_instr.h:1335
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1665
sp_instr_copen(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1337
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1706
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1358
static PSI_statement_info psi_info
Definition: sp_instr.h:1360
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1354
sp_instr_cpop instruction is added at the end of BEGIN..END block.
Definition: sp_instr.h:1301
uint m_count
Definition: sp_instr.h:1319
static PSI_statement_info psi_info
Definition: sp_instr.h:1325
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1323
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1648
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1641
sp_instr_cpop(uint ip, sp_pcontext *ctx, uint count)
Definition: sp_instr.h:1303
sp_instr_cpush corresponds to DECLARE CURSOR, implements DECLARE CURSOR and OPEN.
Definition: sp_instr.h:1230
bool is_invalid() const override
Definition: sp_instr.h:1263
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:1271
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1265
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1289
static PSI_statement_info psi_info
Definition: sp_instr.h:1291
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1285
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1596
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:1267
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1613
LEX_CSTRING m_cursor_query
This attribute keeps the cursor SELECT statement.
Definition: sp_instr.h:1278
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1604
bool m_valid
Flag if the LEX-object of this instruction is valid or not.
Definition: sp_instr.h:1282
sp_instr_cpush(uint ip, sp_pcontext *ctx, LEX *cursor_lex, LEX_CSTRING cursor_query, int cursor_idx)
Definition: sp_instr.h:1232
sp_instr_error just throws an SQL-condition if the execution flow comes to it.
Definition: sp_instr.h:1449
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:1464
sp_instr_error(uint ip, sp_pcontext *ctx, int errcode)
Definition: sp_instr.h:1451
int m_errcode
The error code, which should be raised by this instruction.
Definition: sp_instr.h:1477
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1481
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:1470
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1815
static PSI_statement_info psi_info
Definition: sp_instr.h:1483
sp_instr_freturn represents RETURN statement in stored functions.
Definition: sp_instr.h:652
LEX_CSTRING m_expr_query
SQL-query corresponding to the RETURN-expression.
Definition: sp_instr.h:707
static PSI_statement_info psi_info
Definition: sp_instr.h:716
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:684
Item * m_expr_item
RETURN-expression item.
Definition: sp_instr.h:704
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1400
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:695
enum enum_field_types m_return_field_type
RETURN-field type code.
Definition: sp_instr.h:710
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:654
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:689
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:714
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1419
bool is_invalid() const override
Definition: sp_instr.h:682
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:697
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:671
Definition: sp_instr.h:1147
void print(const THD *, String *str) override
Definition: sp_instr.h:1155
static PSI_statement_info psi_info
Definition: sp_instr.h:1169
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1167
sp_instr_hpop(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:1149
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1515
Definition: sp_instr.h:1087
sp_instr_hpush_jump(uint ip, sp_pcontext *ctx, sp_handler *handler)
Definition: sp_instr.cc:1439
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1463
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1112
uint m_opt_hpop
hpop marking end of handler scope.
Definition: sp_instr.h:1131
sp_handler * m_handler
Handler.
Definition: sp_instr.h:1128
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:1118
~sp_instr_hpush_jump() override
Definition: sp_instr.cc:1448
uint m_frame
Definition: sp_instr.h:1135
static PSI_statement_info psi_info
Definition: sp_instr.h:1141
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1457
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:1475
void add_condition(sp_condition_value *condition_value)
Definition: sp_instr.cc:1453
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1139
sp_handler * get_handler()
Definition: sp_instr.h:1095
Definition: sp_instr.h:1175
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1203
uint m_frame
Definition: sp_instr.h:1199
static PSI_statement_info psi_info
Definition: sp_instr.h:1205
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1192
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:1569
sp_instr_hreturn(uint ip, sp_pcontext *ctx)
Definition: sp_instr.cc:1531
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1534
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1555
sp_instr_jump_case_when instruction is used in the "simple CASE" implementation.
Definition: sp_instr.h:1012
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1340
int m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:1063
static PSI_statement_info psi_info
Definition: sp_instr.h:1079
Item_case_expr * m_case_expr_item
Item representing the CASE-expression.
Definition: sp_instr.h:1066
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:1353
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1032
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:1073
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:1014
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1077
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1328
sp_instr_jump_if_not implements SP-instruction, which does the jump if its SQL-expression is false.
Definition: sp_instr.h:888
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:890
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:912
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1257
static PSI_statement_info psi_info
Definition: sp_instr.h:922
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:895
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:920
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1245
This is base class for all kinds of jump instructions.
Definition: sp_instr.h:732
sp_instr_jump(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:734
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:784
sp_instr * m_optdest
Definition: sp_instr.h:780
sp_instr_jump(uint ip, sp_pcontext *ctx, uint dest)
Definition: sp_instr.h:737
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:1204
uint m_dest
Where we will go.
Definition: sp_instr.h:777
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:769
static PSI_statement_info psi_info
Definition: sp_instr.h:786
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1197
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:1227
uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
Short-cut jumps to jumps during optimization.
Definition: sp_instr.cc:1212
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:750
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:765
sp_instr_set_case_expr is used in the "simple CASE" implementation to evaluate and store the CASE-exp...
Definition: sp_instr.h:934
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:973
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1855
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:1881
static PSI_statement_info psi_info
Definition: sp_instr.h:999
uint m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:993
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:985
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:997
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1832
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:936
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:1867
void backpatch(uint) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:977
sp_instr_set_trigger_field represents SET-statements, which deal with NEW/OLD trigger pseudo-rows.
Definition: sp_instr.h:593
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:595
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:1161
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:641
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1135
bool is_invalid() const override
Definition: sp_instr.h:616
static PSI_statement_info psi_info
Definition: sp_instr.h:643
Item_trigger_field * m_trigger_field
Item corresponding to the NEW/OLD trigger field.
Definition: sp_instr.h:631
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:1181
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1154
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:618
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:624
LEX_CSTRING m_trigger_field_name
Trigger field name ("field_name" of the "NEW.field_name").
Definition: sp_instr.h:628
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:637
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:634
sp_instr_set represents SET-statements, which deal with SP-variables.
Definition: sp_instr.h:531
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:563
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:578
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:556
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:565
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1090
sp_instr_set(uint ip, LEX *lex, uint offset, Item *value_item, LEX_CSTRING value_query, bool is_lex_owner)
Definition: sp_instr.h:533
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1107
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:554
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:575
bool is_invalid() const override
Definition: sp_instr.h:552
static PSI_statement_info psi_info
Definition: sp_instr.h:582
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:583
uint m_offset
Frame offset.
Definition: sp_instr.h:572
sp_instr_stmt represents almost all conventional SQL-statements, which are supported outside stored p...
Definition: sp_instr.h:473
bool is_invalid() const override
Definition: sp_instr.h:498
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:500
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1036
sp_instr_stmt(uint ip, LEX *lex, LEX_CSTRING query)
Definition: sp_instr.h:475
static PSI_statement_info psi_info
Definition: sp_instr.h:522
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:506
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1060
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:932
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:520
bool m_valid
Specify if the stored LEX-object is up-to-date.
Definition: sp_instr.h:516
LEX_CSTRING m_query
Complete query of the SQL-statement.
Definition: sp_instr.h:513
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:502
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:796
sp_instr * m_cont_optdest
Definition: sp_instr.h:873
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:808
uint m_dest
Where we will go.
Definition: sp_instr.h:866
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:1298
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:798
uint m_cont_dest
Where continue handlers will go.
Definition: sp_instr.h:869
bool is_invalid() const override
Definition: sp_instr.h:835
sp_instr * m_optdest
Definition: sp_instr.h:872
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:847
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:1274
LEX_CSTRING m_expr_query
SQL-query corresponding to the expression.
Definition: sp_instr.h:879
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:859
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:841
Item * m_expr_item
Expression item.
Definition: sp_instr.h:876
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:837
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:853
uint get_cont_dest() const override
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:829
void set_cont_dest(uint cont_dest)
Definition: sp_instr.h:819
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:456
void set_lex(LEX *lex, bool is_lex_owner)
Set LEX-object.
Definition: sp_instr.cc:872
virtual LEX_CSTRING get_expr_query() const
Definition: sp_instr.h:392
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:450
LEX * m_lex
LEX-object.
Definition: sp_instr.h:417
virtual void get_query(String *sql_query) const
Return the query string, which can be passed to the parser.
Definition: sp_instr.cc:911
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:380
SQL_I_List< Item_trigger_field > m_trig_field_list
List of all the Item_trigger_field's of instruction.
Definition: sp_instr.h:461
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:709
LEX * parse_expr(THD *thd, sp_head *sp)
(Re-)parse the query corresponding to this instruction and return a new LEX-object.
Definition: sp_instr.cc:573
void free_lex()
Cleanup and destroy assigned LEX-object if needed.
Definition: sp_instr.cc:882
bool m_is_lex_owner
Indicates whether this sp_lex_instr instance is responsible for LEX-object deletion.
Definition: sp_instr.h:431
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:327
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:437
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:404
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:898
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:425
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:5873
#define alloc_root_inited(A)
Definition: my_sys.h:817
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:4772
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:1081
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:127
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:3823
bool safe_to_cache_query
Whether this query will return the same answer every time, given unchanged data.
Definition: sql_lex.h:4183
Query_block * query_block
First query block.
Definition: sql_lex.h:3828
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:42