MySQL 5.6.14 Source Code Document
|
#include <sp_instr.h>
Public Member Functions | |
sp_lex_instr (uint ip, sp_pcontext *ctx, LEX *lex, bool is_lex_owner) | |
bool | validate_lex_and_execute_core (THD *thd, uint *nextp, bool open_tables) |
virtual bool | execute (THD *thd, uint *nextp) |
Public Member Functions inherited from sp_instr | |
sp_instr (uint ip, sp_pcontext *ctx) | |
uint | get_ip () const |
virtual uint | get_cont_dest () const |
sp_pcontext * | get_parsing_ctx () const |
virtual uint | opt_mark (sp_head *sp, List< sp_instr > *leads) |
virtual uint | opt_shortcut_jump (sp_head *sp, sp_instr *start) |
virtual void | opt_move (uint dst, List< sp_branch_instr > *ibp) |
bool | opt_is_marked () const |
Public Member Functions inherited from sp_printable | |
virtual void | print (String *str)=0 |
Protected Member Functions | |
virtual bool | exec_core (THD *thd, uint *nextp)=0 |
virtual bool | is_invalid () const =0 |
virtual void | invalidate ()=0 |
virtual void | get_query (String *sql_query) const |
virtual LEX_STRING | get_expr_query () const |
virtual bool | on_after_expr_parsing (THD *thd) |
virtual void | cleanup_before_parsing (THD *thd) |
Additional Inherited Members | |
Static Public Member Functions inherited from Sql_alloc | |
static void * | operator new (size_t size) throw () |
static void * | operator new[] (size_t size) throw () |
static void * | operator new[] (size_t size, MEM_ROOT *mem_root) throw () |
static void * | operator new (size_t size, MEM_ROOT *mem_root) throw () |
static void | operator delete (void *ptr, size_t size) |
static void | operator delete (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, size_t size) |
Protected Attributes inherited from sp_instr | |
bool | m_marked |
uint | m_ip |
Instruction pointer. | |
sp_pcontext * | m_parsing_ctx |
Instruction parsing context. |
sp_lex_instr is a class providing the interface and base implementation for SP-instructions, whose execution is based on expression evaluation.
sp_lex_instr keeps LEX-object to be able to evaluate the expression.
sp_lex_instr also provides possibility to re-parse the original query string if for some reason the LEX-object is not valid any longer.
Definition at line 168 of file sp_instr.h.
|
protectedvirtual |
Destroy items in the free list before re-parsing the statement query string (and thus, creating new items).
thd | Thread context. |
Reimplemented in sp_instr_set_trigger_field.
Definition at line 694 of file sp_instr.cc.
|
protectedpure virtual |
Execute core function of instruction after all preparations (e.g. setting of proper LEX, saving part of the thread context).
thd | Thread context. |
nextp[out] | next instruction pointer |
Implemented in sp_instr_cpush, sp_instr_jump_case_when, sp_instr_set_case_expr, sp_instr_jump_if_not, sp_instr_freturn, sp_instr_set_trigger_field, sp_instr_set, and sp_instr_stmt.
|
inlinevirtual |
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. |
Implements sp_instr.
Reimplemented in sp_instr_cpush, and sp_instr_stmt.
Definition at line 271 of file sp_instr.h.
|
inlineprotectedvirtual |
Reimplemented in sp_lex_branch_instr, sp_instr_freturn, sp_instr_set_trigger_field, and sp_instr_set.
Definition at line 323 of file sp_instr.h.
|
protectedvirtual |
Return the query string, which can be passed to the parser. I.e. the operation should return a valid SQL-statement query string.
[out] | sql_query | SQL-statement query string. |
Reimplemented in sp_instr_cpush, and sp_instr_stmt.
Definition at line 718 of file sp_instr.cc.
|
protectedpure virtual |
Invalidate the object.
Implemented in sp_instr_cpush, sp_instr_jump_case_when, sp_lex_branch_instr, sp_instr_freturn, sp_instr_set_trigger_field, sp_instr_set, and sp_instr_stmt.
|
protectedpure virtual |
false | if the object (i.e. LEX-object) is valid and exec_core() can be just called. |
true | if the object is not valid any longer, exec_core() can not be called. The original query string should be re-parsed and a new LEX-object should be used. |
Implemented in sp_instr_cpush, sp_lex_branch_instr, sp_instr_freturn, sp_instr_set_trigger_field, sp_instr_set, and sp_instr_stmt.
|
inlineprotectedvirtual |
Callback function which is called after the statement query string is successfully parsed, and the thread context has not been switched to the outer context. The thread context contains new LEX-object corresponding to the parsed query string.
thd | Thread context. |
Reimplemented in sp_instr_cpush, sp_instr_jump_case_when, sp_instr_set_case_expr, sp_instr_jump_if_not, sp_instr_freturn, sp_instr_set_trigger_field, sp_instr_set, and sp_instr_stmt.
Definition at line 336 of file sp_instr.h.
bool sp_lex_instr::validate_lex_and_execute_core | ( | THD * | thd, |
uint * | nextp, | ||
bool | open_tables | ||
) |
Make a few attempts to execute the instruction.
Basically, this operation does the following things:
thd | Thread context. | |
[out] | nextp | Next instruction pointer |
open_tables | Flag to specify if the function should check read access to tables in LEX's table list and open and lock them (used in instructions which need to calculate some expression and don't execute complete statement). |
Definition at line 576 of file sp_instr.cc.