MySQL 9.0.0
Source Code Documentation
|
Base class for every SP-instruction. More...
#include <sp_instr.h>
Public Member Functions | |
sp_instr (uint ip, sp_pcontext *ctx) | |
~sp_instr () override | |
virtual bool | execute (THD *thd, uint *nextp)=0 |
Execute this instruction. More... | |
virtual PSI_statement_info * | get_psi_info ()=0 |
uint | get_ip () const |
virtual uint | get_cont_dest () const |
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction. More... | |
sp_pcontext * | get_parsing_ctx () const |
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. More... | |
virtual uint | opt_shortcut_jump (sp_head *, sp_instr *start) |
Short-cut jumps to jumps during optimization. More... | |
virtual void | opt_move (uint dst, List< sp_branch_instr > *ibp) |
Inform the instruction that it has been moved during optimization. More... | |
bool | opt_is_marked () const |
virtual SQL_I_List< Item_trigger_field > * | get_instr_trig_field_list () |
Public Member Functions inherited from sp_printable | |
virtual void | print (const THD *thd, String *str)=0 |
virtual | ~sp_printable ()=default |
Public Attributes | |
Query_arena | m_arena |
Protected Member Functions | |
void | clear_da (THD *thd) const |
Clear diagnostics area. More... | |
Protected Attributes | |
bool | m_marked |
Show if this instruction is reachable within the SP (used by SP-optimizer). More... | |
uint | m_ip |
Instruction pointer. More... | |
sp_pcontext * | m_parsing_ctx |
Instruction parsing context. More... | |
Private Member Functions | |
sp_instr (const sp_instr &) | |
void | operator= (sp_instr &) |
Base class for every SP-instruction.
sp_instr defines interface and provides base implementation.
|
inline |
|
inlineoverride |
|
private |
|
inlineprotected |
Clear diagnostics area.
thd | Thread context |
|
pure virtual |
Execute this instruction.
thd | Thread context | |
[out] | nextp | index of the next instruction to execute. (For most instructions this will be the instruction following this one). Note that this parameter is undefined in case of errors, use get_cont_dest() to find the continuation instruction for CONTINUE error handlers. |
Implemented in sp_instr_jump, sp_instr_error, sp_lex_instr, sp_instr_stmt, sp_instr_hpush_jump, sp_instr_hpop, sp_instr_hreturn, sp_instr_cpush, sp_instr_cpop, sp_instr_copen, sp_instr_cclose, and sp_instr_cfetch.
|
inlinevirtual |
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Reimplemented in sp_lex_branch_instr.
|
inlinevirtual |
Reimplemented in sp_lex_instr.
|
inline |
|
inline |
|
pure virtual |
Implemented in sp_instr_stmt, sp_instr_set, sp_instr_set_trigger_field, sp_instr_freturn, sp_instr_jump, sp_instr_jump_if_not, sp_instr_set_case_expr, sp_instr_jump_case_when, sp_instr_hpush_jump, sp_instr_hpop, sp_instr_hreturn, sp_instr_cpush, sp_instr_cpop, sp_instr_copen, sp_instr_cclose, sp_instr_cfetch, and sp_instr_error.
|
private |
|
inline |
Mark this instruction as reachable during optimization and return the index to the next instruction.
Jump instruction will add their destination to the leads list.
Reimplemented in sp_instr_freturn, sp_instr_error, sp_instr_jump, sp_lex_branch_instr, sp_instr_set_case_expr, sp_instr_hpush_jump, and sp_instr_hreturn.
|
inlinevirtual |
Inform the instruction that it has been moved during optimization.
Most instructions will simply update its index, but jump instructions must also take care of their destination pointers. Forward jumps get pushed to the backpatch list 'ibp'.
Reimplemented in sp_instr_jump, sp_lex_branch_instr, and sp_instr_set_case_expr.
Short-cut jumps to jumps during optimization.
This is used by the jump instructions' opt_mark() methods. 'start' is the starting point, used to prevent the mark sweep from looping for ever. Return the end destination.
Reimplemented in sp_instr_hpush_jump, sp_instr_hreturn, and sp_instr_jump.
Query_arena sp_instr::m_arena |
|
protected |
Instruction pointer.
|
protected |
Show if this instruction is reachable within the SP (used by SP-optimizer).
|
protected |
Instruction parsing context.