127#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),
706#ifdef HAVE_PSI_INTERFACE
776#ifdef HAVE_PSI_INTERFACE
887 expr_item, expr_query) {}
892 expr_item, expr_query, dest) {}
912#ifdef HAVE_PSI_INTERFACE
933 case_expr_item, case_expr_query),
989#ifdef HAVE_PSI_INTERFACE
1011 when_expr_item, when_expr_query),
1069#ifdef HAVE_PSI_INTERFACE
1131#ifdef HAVE_PSI_INTERFACE
1159#ifdef HAVE_PSI_INTERFACE
1195#ifdef HAVE_PSI_INTERFACE
1281#ifdef HAVE_PSI_INTERFACE
1315#ifdef HAVE_PSI_INTERFACE
1350#ifdef HAVE_PSI_INTERFACE
1386#ifdef HAVE_PSI_INTERFACE
1427#ifdef HAVE_PSI_INTERFACE
1473#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
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
void reset_condition_info(THD *thd)
Reset the current condition information stored in the Diagnostics Area.
Definition: sql_error.cc:484
void reset_diagnostics_area()
Clear this Diagnostics Area.
Definition: sql_error.cc:359
Represents NEW/OLD version of field of row which is changed/read in trigger.
Definition: item.h:6711
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:932
Definition: sql_list.h:433
Definition: sql_class.h:347
void free_items()
Definition: sql_class.cc:2027
enum_sql_command sql_command
SQL command for this statement.
Definition: sql_lex.h:2525
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:418
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
LEX * lex
Definition: sql_class.h:989
Diagnostics_area * get_stmt_da()
Returns first Diagnostics Area for the current statement.
Definition: sql_class.h:3237
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4501
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:382
The instruction corresponds to the CLOSE statement.
Definition: sp_instr.h:1365
static PSI_statement_info psi_info
Definition: sp_instr.h:1390
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1696
sp_instr_cclose(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1367
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1384
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1707
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1388
The instruction corresponds to the FETCH statement.
Definition: sp_instr.h:1401
List< sp_variable > m_varlist
List of SP-variables to store fetched values.
Definition: sp_instr.h:1422
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1429
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1732
sp_instr_cfetch(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1403
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1743
static PSI_statement_info psi_info
Definition: sp_instr.h:1431
void add_to_varlist(sp_variable *var)
Definition: sp_instr.h:1418
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1425
sp_instr_copen represents OPEN statement (opens the cursor).
Definition: sp_instr.h:1329
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1630
sp_instr_copen(uint ip, sp_pcontext *ctx, int cursor_idx)
Definition: sp_instr.h:1331
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1671
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1352
static PSI_statement_info psi_info
Definition: sp_instr.h:1354
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1348
sp_instr_cpop instruction is added at the end of BEGIN..END block.
Definition: sp_instr.h:1295
uint m_count
Definition: sp_instr.h:1313
static PSI_statement_info psi_info
Definition: sp_instr.h:1319
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1317
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1615
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1608
sp_instr_cpop(uint ip, sp_pcontext *ctx, uint count)
Definition: sp_instr.h:1297
sp_instr_cpush corresponds to DECLARE CURSOR, implements DECLARE CURSOR and OPEN.
Definition: sp_instr.h:1224
bool is_invalid() const override
Definition: sp_instr.h:1257
bool on_after_expr_parsing(THD *) override
Callback function which is called after the statement query string is successfully parsed,...
Definition: sp_instr.h:1265
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1259
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1283
static PSI_statement_info psi_info
Definition: sp_instr.h:1285
int m_cursor_idx
Used to identify the cursor in the sp_rcontext.
Definition: sp_instr.h:1279
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1565
void get_query(String *sql_query) const override
Return the query string, which can be passed to the parser.
Definition: sp_instr.h:1261
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1582
LEX_CSTRING m_cursor_query
This attribute keeps the cursor SELECT statement.
Definition: sp_instr.h:1272
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1573
bool m_valid
Flag if the LEX-object of this instruction is valid or not.
Definition: sp_instr.h:1276
sp_instr_cpush(uint ip, sp_pcontext *ctx, LEX *cursor_lex, LEX_CSTRING cursor_query, int cursor_idx)
Definition: sp_instr.h:1226
sp_instr_error just throws an SQL-condition if the execution flow comes to it.
Definition: sp_instr.h:1443
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:1458
sp_instr_error(uint ip, sp_pcontext *ctx, int errcode)
Definition: sp_instr.h:1445
int m_errcode
The error code, which should be raised by this instruction.
Definition: sp_instr.h:1471
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1475
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:1464
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1776
static PSI_statement_info psi_info
Definition: sp_instr.h:1477
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:701
static PSI_statement_info psi_info
Definition: sp_instr.h:710
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:683
Item * m_expr_item
RETURN-expression item.
Definition: sp_instr.h:698
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1375
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:704
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:708
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1394
bool is_invalid() const override
Definition: sp_instr.h:681
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:1141
void print(const THD *, String *str) override
Definition: sp_instr.h:1149
static PSI_statement_info psi_info
Definition: sp_instr.h:1163
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1161
sp_instr_hpop(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:1143
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1487
Definition: sp_instr.h:1081
sp_instr_hpush_jump(uint ip, sp_pcontext *ctx, sp_handler *handler)
Definition: sp_instr.cc:1413
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1437
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1106
uint m_opt_hpop
hpop marking end of handler scope.
Definition: sp_instr.h:1125
sp_handler * m_handler
Handler.
Definition: sp_instr.h:1122
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:1112
~sp_instr_hpush_jump() override
Definition: sp_instr.cc:1422
uint m_frame
Definition: sp_instr.h:1129
static PSI_statement_info psi_info
Definition: sp_instr.h:1135
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1431
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:1449
void add_condition(sp_condition_value *condition_value)
Definition: sp_instr.cc:1427
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1133
sp_handler * get_handler()
Definition: sp_instr.h:1089
Definition: sp_instr.h:1169
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1197
uint m_frame
Definition: sp_instr.h:1193
static PSI_statement_info psi_info
Definition: sp_instr.h:1199
uint opt_shortcut_jump(sp_head *, sp_instr *) override
Override sp_instr_jump's shortcut; we stop here.
Definition: sp_instr.h:1186
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:1540
sp_instr_hreturn(uint ip, sp_pcontext *ctx)
Definition: sp_instr.cc:1502
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:1505
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1526
sp_instr_jump_case_when instruction is used in the "simple CASE" implementation.
Definition: sp_instr.h:1006
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1316
int m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:1057
static PSI_statement_info psi_info
Definition: sp_instr.h:1073
Item_case_expr * m_case_expr_item
Item representing the CASE-expression.
Definition: sp_instr.h:1060
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:1329
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:1026
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:1067
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:1008
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:1071
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1304
sp_instr_jump_if_not implements SP-instruction, which does the jump if its SQL-expression is false.
Definition: sp_instr.h:882
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:884
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:906
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1234
static PSI_statement_info psi_info
Definition: sp_instr.h:916
sp_instr_jump_if_not(uint ip, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:889
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:914
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1222
This is base class for all kinds of jump instructions.
Definition: sp_instr.h:726
sp_instr_jump(uint ip, sp_pcontext *ctx)
Definition: sp_instr.h:728
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:778
sp_instr * m_optdest
Definition: sp_instr.h:774
sp_instr_jump(uint ip, sp_pcontext *ctx, uint dest)
Definition: sp_instr.h:731
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:1182
uint m_dest
Where we will go.
Definition: sp_instr.h:771
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:763
static PSI_statement_info psi_info
Definition: sp_instr.h:780
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1175
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:1205
uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override
Short-cut jumps to jumps during optimization.
Definition: sp_instr.cc:1190
bool execute(THD *, uint *nextp) override
Execute this instruction.
Definition: sp_instr.h:744
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:759
sp_instr_set_case_expr is used in the "simple CASE" implementation to evaluate and store the CASE-exp...
Definition: sp_instr.h:928
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:967
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1815
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:1841
static PSI_statement_info psi_info
Definition: sp_instr.h:993
uint m_case_expr_id
Identifier (index) of the CASE-expression in the runtime context.
Definition: sp_instr.h:987
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:979
PSI_statement_info * get_psi_info() override
Definition: sp_instr.h:991
bool exec_core(THD *thd, uint *nextp) override
Execute core function of instruction after all preparations (e.g.
Definition: sp_instr.cc:1792
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:930
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:1827
void backpatch(uint) override
Update all instruction with the given label in the backpatch list to the specified instruction pointe...
Definition: sp_instr.h:971
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:1141
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:1115
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:1161
void print(const THD *thd, String *str) override
Definition: sp_instr.cc:1134
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:1072
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:1088
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:1020
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:1044
bool execute(THD *thd, uint *nextp) override
Execute this instruction.
Definition: sp_instr.cc:916
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: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:790
sp_instr * m_cont_optdest
Definition: sp_instr.h:867
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query, uint dest)
Definition: sp_instr.h:802
uint m_dest
Where we will go.
Definition: sp_instr.h:860
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:1275
sp_lex_branch_instr(uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_CSTRING expr_query)
Definition: sp_instr.h:792
uint m_cont_dest
Where continue handlers will go.
Definition: sp_instr.h:863
bool is_invalid() const override
Definition: sp_instr.h:829
sp_instr * m_optdest
Definition: sp_instr.h:866
void set_destination(uint old_dest, uint new_dest) override
Update the destination; used by the SP-instruction-optimizer.
Definition: sp_instr.h:841
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:1251
LEX_CSTRING m_expr_query
SQL-query corresponding to the expression.
Definition: sp_instr.h:873
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:853
LEX_CSTRING get_expr_query() const override
Definition: sp_instr.h:835
Item * m_expr_item
Expression item.
Definition: sp_instr.h:870
void invalidate() override
Invalidate the object.
Definition: sp_instr.h:831
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:847
uint get_cont_dest() const override
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Definition: sp_instr.h:823
void set_cont_dest(uint cont_dest)
Definition: sp_instr.h:813
sp_lex_instr is a class providing the interface and base implementation for SP-instructions,...
Definition: sp_instr.h:223
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:317
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:385
~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:455
void set_lex(LEX *lex, bool is_lex_owner)
Set LEX-object.
Definition: sp_instr.cc:858
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:896
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: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:706
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:570
void free_lex()
Cleanup and destroy assigned LEX-object if needed.
Definition: sp_instr.cc:868
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:883
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:424
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
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:54
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:5820
#define alloc_root_inited(A)
Definition: my_sys.h:816
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:4599
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
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:207
@ SQLCOM_SET_OPTION
Definition: my_sqlcommand.h:77
Common header for many mysys elements.
static int count
Definition: myisam_ftdump.cc:44
static char * query
Definition: myisam_ftdump.cc:46
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1085
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:28
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3721
bool safe_to_cache_query
Whether this query will return the same answer every time, given unchanged data.
Definition: sql_lex.h:3995
Query_block * query_block
First query block.
Definition: sql_lex.h:3726
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:132
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:41