127#ifdef HAVE_PSI_INTERFACE
473 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
515#ifdef HAVE_PSI_INTERFACE
532 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, is_lex_owner),
577#ifdef HAVE_PSI_INTERFACE
595 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
636#ifdef HAVE_PSI_INTERFACE
653 :
sp_lex_instr(ip, lex->get_sp_current_parsing_ctx(), lex, true),
704#ifdef HAVE_PSI_INTERFACE
774#ifdef HAVE_PSI_INTERFACE
885 expr_item, expr_query) {}
890 expr_item, expr_query, dest) {}
910#ifdef HAVE_PSI_INTERFACE
931 case_expr_item, case_expr_query),
987#ifdef HAVE_PSI_INTERFACE
1009 when_expr_item, when_expr_query),
1067#ifdef HAVE_PSI_INTERFACE
1129#ifdef HAVE_PSI_INTERFACE
1157#ifdef HAVE_PSI_INTERFACE
1193#ifdef HAVE_PSI_INTERFACE
1279#ifdef HAVE_PSI_INTERFACE
1313#ifdef HAVE_PSI_INTERFACE
1348#ifdef HAVE_PSI_INTERFACE
1384#ifdef HAVE_PSI_INTERFACE
1425#ifdef HAVE_PSI_INTERFACE
1471#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:300
void reset_condition_info(THD *thd)
Reset the current condition information stored in the Diagnostics Area.
Definition: sql_error.cc:479
void reset_diagnostics_area()
Clear this Diagnostics Area.
Definition: sql_error.cc:354
Represents NEW/OLD version of field of row which is changed/read in trigger.
Definition: item.h:6486
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:850
Definition: sql_list.h:433
Definition: sql_class.h:342
void free_items()
Definition: sql_class.cc:2005
enum_sql_command sql_command
SQL command for this statement.
Definition: sql_lex.h:2500
Simple intrusive linked list.
Definition: sql_list.h:45
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
bool append(const String &s)
Definition: sql_string.cc:445
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
LEX * lex
Definition: sql_class.h:995
Diagnostics_area * get_stmt_da()
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3222
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4354
An interface for all SP-instructions with destinations that need to be updated by the SP-optimizer.
Definition: sp_instr.h:77
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:132
This class represents 'DECLARE HANDLER' statement.
Definition: sp_pcontext.h:192
sp_head represents one instance of a stored program.
Definition: sp_head.h:379
The instruction corresponds to the CLOSE statement.
Definition: sp_instr.h:1363
static PSI_statement_info psi_info
Definition: sp_instr.h:1388
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1614
sp_instr_cclose(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1365
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1382
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1625
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1386
The instruction corresponds to the FETCH statement.
Definition: sp_instr.h:1399
List< sp_variable > m_varlist
List of SP-variables to store fetched values.
Definition: sp_instr.h:1420
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1427
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1650
sp_instr_cfetch(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1401
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1661
static PSI_statement_info psi_info
Definition: sp_instr.h:1429
void add_to_varlist(sp_variable *var)
Definition: sp_instr.h:1416
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1423
sp_instr_copen represents OPEN statement (opens the cursor).
Definition: sp_instr.h:1327
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1548
sp_instr_copen(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1329
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1589
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1350
static PSI_statement_info psi_info
Definition: sp_instr.h:1352
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1346
sp_instr_cpop instruction is added at the end of BEGIN..END block.
Definition: sp_instr.h:1293
uint m_count
Definition: sp_instr.h:1311
static PSI_statement_info psi_info
Definition: sp_instr.h:1317
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1315
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1533
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1526
sp_instr_cpop(uint ip, sp_pcontext *ctx, uint count)
Definition: sp_instr.h:1295
sp_instr_cpush corresponds to DECLARE CURSOR, implements DECLARE CURSOR and OPEN.
Definition: sp_instr.h:1222
bool is_invalid() const override
Definition: sp_instr.h:1255
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:1263
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1257
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1281
static PSI_statement_info psi_info
Definition: sp_instr.h:1283
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1277
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1483
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:1259
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1500
LEX_CSTRING m_cursor_query
This attribute keeps the cursor SELECT statement.
Definition: sp_instr.h:1270
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1491
bool m_valid
Flag if the LEX-object of this instruction is valid or not.
Definition: sp_instr.h:1274
sp_instr_cpush(uint ip, sp_pcontext *ctx, LEX *cursor_lex, LEX_CSTRING cursor_query, int cursor_idx)
Definition: sp_instr.h:1224
sp_instr_error just throws an SQL-condition if the execution flow comes to it.
Definition: sp_instr.h:1441
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:1456
sp_instr_error(uint ip, sp_pcontext *ctx, int errcode)
Definition: sp_instr.h:1443
int m_errcode
The error code, which should be raised by this instruction.
Definition: sp_instr.h:1469
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1473
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:1462
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1694
static PSI_statement_info psi_info
Definition: sp_instr.h:1475
sp_instr_freturn represents RETURN statement in stored functions.
Definition: sp_instr.h:649
LEX_CSTRING m_expr_query
SQL-query corresponding to the RETURN-expression.
Definition: sp_instr.h:699
static PSI_statement_info psi_info
Definition: sp_instr.h:708
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:681
Item * m_expr_item
RETURN-expression item.
Definition: sp_instr.h:696
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1293
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:692
enum enum_field_types m_return_field_type
RETURN-field type code.
Definition: sp_instr.h:702
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:651
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:686
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:706
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1312
bool is_invalid() const override
Definition: sp_instr.h:679
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:668
Definition: sp_instr.h:1139
void print(const THD *, String *str) override
Definition: sp_instr.h:1147
static PSI_statement_info psi_info
Definition: sp_instr.h:1161
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1159
sp_instr_hpop(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:1141
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1405
Definition: sp_instr.h:1079
sp_instr_hpush_jump(uint ip, sp_pcontext *ctx, sp_handler *handler)
Definition: sp_instr.cc:1331
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1355
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1104
uint m_opt_hpop
hpop marking end of handler scope.
Definition: sp_instr.h:1123
sp_handler * m_handler
Handler.
Definition: sp_instr.h:1120
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:1110
~sp_instr_hpush_jump() override
Definition: sp_instr.cc:1340
uint m_frame
Definition: sp_instr.h:1127
static PSI_statement_info psi_info
Definition: sp_instr.h:1133
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1349
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:1367
void add_condition(sp_condition_value *condition_value)
Definition: sp_instr.cc:1345
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1131
sp_handler * get_handler()
Definition: sp_instr.h:1087
Definition: sp_instr.h:1167
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1195
uint m_frame
Definition: sp_instr.h:1191
static PSI_statement_info psi_info
Definition: sp_instr.h:1197
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1184
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:1458
sp_instr_hreturn(uint ip, sp_pcontext *ctx)
Definition: sp_instr.cc:1420
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1423
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1444
sp_instr_jump_case_when instruction is used in the "simple CASE" implementation.
Definition: sp_instr.h:1004
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1234
int m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:1055
static PSI_statement_info psi_info
Definition: sp_instr.h:1071
Item_case_expr * m_case_expr_item
Item representing the CASE-expression.
Definition: sp_instr.h:1058
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:1247
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1024
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:1065
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:1006
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1069
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1222
sp_instr_jump_if_not implements SP-instruction, which does the jump if its SQL-expression is false.
Definition: sp_instr.h:880
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:882
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:904
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1152
static PSI_statement_info psi_info
Definition: sp_instr.h:914
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:887
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:912
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1140
This is base class for all kinds of jump instructions.
Definition: sp_instr.h:724
sp_instr_jump(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:726
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:776
sp_instr * m_optdest
Definition: sp_instr.h:772
sp_instr_jump(uint ip, sp_pcontext *ctx, uint dest)
Definition: sp_instr.h:729
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:1100
uint m_dest
Where we will go.
Definition: sp_instr.h:769
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:761
static PSI_statement_info psi_info
Definition: sp_instr.h:778
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1093
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:1123
uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
Short-cut jumps to jumps during optimization.
Definition: sp_instr.cc:1108
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:742
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:757
sp_instr_set_case_expr is used in the "simple CASE" implementation to evaluate and store the CASE-exp...
Definition: sp_instr.h:926
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:965
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1733
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:1759
static PSI_statement_info psi_info
Definition: sp_instr.h:991
uint m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:985
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:977
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:989
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1710
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:928
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:1745
void backpatch(uint) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:969
sp_instr_set_trigger_field represents SET-statements, which deal with NEW/OLD trigger pseudo-rows.
Definition: sp_instr.h:590
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:592
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:1059
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:638
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1033
bool is_invalid() const override
Definition: sp_instr.h:613
static PSI_statement_info psi_info
Definition: sp_instr.h:640
Item_trigger_field * m_trigger_field
Item corresponding to the NEW/OLD trigger field.
Definition: sp_instr.h:628
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:1079
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1052
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:615
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:621
LEX_CSTRING m_trigger_field_name
Trigger field name ("field_name" of the "NEW.field_name").
Definition: sp_instr.h:625
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:634
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:631
sp_instr_set represents SET-statements, which deal with SP-variables.
Definition: sp_instr.h:528
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:560
LEX_CSTRING m_value_query
SQL-query corresponding to the value expression.
Definition: sp_instr.h:575
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:553
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:562
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:990
sp_instr_set(uint ip, LEX *lex, uint offset, Item *value_item, LEX_CSTRING value_query, bool is_lex_owner)
Definition: sp_instr.h:530
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1006
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:551
Item * m_value_item
Value expression item of the SET-statement.
Definition: sp_instr.h:572
bool is_invalid() const override
Definition: sp_instr.h:549
static PSI_statement_info psi_info
Definition: sp_instr.h:579
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:580
uint m_offset
Frame offset.
Definition: sp_instr.h:569
sp_instr_stmt represents almost all conventional SQL-statements, which are supported outside stored p...
Definition: sp_instr.h:470
bool is_invalid() const override
Definition: sp_instr.h:495
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:497
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:938
sp_instr_stmt(uint ip, LEX *lex, LEX_CSTRING query)
Definition: sp_instr.h:472
static PSI_statement_info psi_info
Definition: sp_instr.h:519
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:503
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:962
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:834
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:517
bool m_valid
Specify if the stored LEX-object is up-to-date.
Definition: sp_instr.h:513
LEX_CSTRING m_query
Complete query of the SQL-statement.
Definition: sp_instr.h:510
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:499
Base class for every SP-instruction.
Definition: sp_instr.h:104
bool m_marked
Show if this instruction is reachable within the SP (used by SP-optimizer).
Definition: sp_instr.h:198
virtual SQL_I_List< Item_trigger_field > * get_instr_trig_field_list()
Definition: sp_instr.h:189
sp_instr(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:106
sp_pcontext * m_parsing_ctx
Instruction parsing context.
Definition: sp_instr.h:204
void clear_da(THD *thd) const
Clear diagnostics area.
Definition: sp_instr.h:147
virtual uint opt_shortcut_jump(sp_head *, sp_instr *start)
Short-cut jumps to jumps during optimization.
Definition: sp_instr.h:173
bool opt_is_marked() const
Definition: sp_instr.h:187
virtual uint get_cont_dest() const
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:138
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:162
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:183
uint m_ip
Instruction pointer.
Definition: sp_instr.h:201
Query_arena m_arena
Definition: sp_instr.h:193
uint get_ip() const
Definition: sp_instr.h:131
virtual PSI_statement_info * get_psi_info()=0
~sp_instr() override
Definition: sp_instr.h:112
sp_pcontext * get_parsing_ctx() const
Definition: sp_instr.h:140
sp_lex_branch_instr is a base class for SP-instructions, which might perform conditional jump dependi...
Definition: sp_instr.h:788
sp_instr * m_cont_optdest
Definition: sp_instr.h:865
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:800
uint m_dest
Where we will go.
Definition: sp_instr.h:858
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:1193
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:790
uint m_cont_dest
Where continue handlers will go.
Definition: sp_instr.h:861
bool is_invalid() const override
Definition: sp_instr.h:827
sp_instr * m_optdest
Definition: sp_instr.h:864
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:839
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:1169
LEX_CSTRING m_expr_query
SQL-query corresponding to the expression.
Definition: sp_instr.h:871
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:851
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:833
Item * m_expr_item
Expression item.
Definition: sp_instr.h:868
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:829
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:845
uint get_cont_dest() const override
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:821
void set_cont_dest(uint cont_dest)
Definition: sp_instr.h:811
sp_lex_instr is a class providing the interface and base implementation for SP-instructions,...
Definition: sp_instr.h:223
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:304
~sp_lex_instr() override
Definition: sp_instr.h:235
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:453
void set_lex(LEX *lex, bool is_lex_owner)
Set LEX-object.
Definition: sp_instr.cc:776
virtual LEX_CSTRING get_expr_query() const
Definition: sp_instr.h:389
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:447
LEX * m_lex
LEX-object.
Definition: sp_instr.h:414
virtual void get_query(String *sql_query) const
Return the query string, which can be passed to the parser.
Definition: sp_instr.cc:814
SQL_I_List< Item_trigger_field > * get_instr_trig_field_list() override
Definition: sp_instr.h:266
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:377
SQL_I_List< Item_trigger_field > m_trig_field_list
List of all the Item_trigger_field's of instruction.
Definition: sp_instr.h:458
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:680
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:544
void free_lex()
Cleanup and destroy assigned LEX-object if needed.
Definition: sp_instr.cc:786
bool m_is_lex_owner
Indicates whether this sp_lex_instr instance is responsible for LEX-object deletion.
Definition: sp_instr.h:428
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:324
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:434
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:401
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:801
sp_lex_instr(uint ip, sp_pcontext *ctx, LEX *lex, bool is_lex_owner)
Definition: sp_instr.h:225
MEM_ROOT m_lex_mem_root
Mem-root for storing the LEX-tree during reparse.
Definition: sp_instr.h:422
The class represents parse-time context, which keeps track of declared variables/parameters,...
Definition: sp_pcontext.h:251
sp_printable defines an interface which should be implemented if a class wants report some internal i...
Definition: sp_instr.h:66
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:48
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
This file contains the field type.
enum_field_types
Column types for MySQL.
Definition: field_types.h:52
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:5757
#define alloc_root_inited(A)
Definition: my_sys.h:808
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:215
Item * single_visible_field() const
Definition: sql_resolver.cc:4834
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:176
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:47
#define STRING_WITH_LEN(X)
Definition: m_string.h:314
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:96
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
@ SQLCOM_SELECT
Definition: my_sqlcommand.h:46
@ SQLCOM_END
Definition: my_sqlcommand.h:206
@ SQLCOM_SET_OPTION
Definition: my_sqlcommand.h:77
Common header for many mysys elements.
static int count
Definition: myisam_ftdump.cc:42
static char * query
Definition: myisam_ftdump.cc:44
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1063
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.
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3693
bool safe_to_cache_query
Whether this query will return the same answer every time, given unchanged data.
Definition: sql_lex.h:3967
Query_block * query_block
First query block.
Definition: sql_lex.h:3698
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Definition: mysql_lex_string.h:39
const char * str
Definition: mysql_lex_string.h:40
size_t length
Definition: mysql_lex_string.h:41
Statement instrument information.
Definition: psi_statement_bits.h:124
unsigned int uint
Definition: uca-dump.cc:29
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:39