MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sp_instr_stmt Class Reference

#include <sp_instr.h>

Inheritance diagram for sp_instr_stmt:
Collaboration diagram for sp_instr_stmt:

Public Member Functions

 sp_instr_stmt (uint ip, LEX *lex, LEX_STRING query)
virtual bool execute (THD *thd, uint *nextp)
virtual void print (String *str)
virtual bool exec_core (THD *thd, uint *nextp)
virtual bool is_invalid () const
virtual void invalidate ()
virtual void get_query (String *sql_query) const
virtual bool on_after_expr_parsing (THD *thd)
- Public Member Functions inherited from sp_lex_instr
 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)
- 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_pcontextget_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

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 Member Functions inherited from sp_lex_instr
virtual LEX_STRING get_expr_query () const
virtual void cleanup_before_parsing (THD *thd)
- Protected Attributes inherited from sp_instr
bool m_marked
uint m_ip
 Instruction pointer.
sp_pcontextm_parsing_ctx
 Instruction parsing context.

Detailed Description

sp_instr_stmt represents almost all conventional SQL-statements, which are supported outside stored programs.

SET-statements, which deal with SP-variable or NEW/OLD trigger pseudo-rows are not represented by this instruction.

Definition at line 399 of file sp_instr.h.

Member Function Documentation

bool sp_instr_stmt::exec_core ( THD *  thd,
uint *  nextp 
)
virtual

Execute core function of instruction after all preparations (e.g. setting of proper LEX, saving part of the thread context).

Parameters
thdThread context.
nextp[out]next instruction pointer
Returns
Error flag.

Implements sp_lex_instr.

Definition at line 882 of file sp_instr.cc.

Here is the call graph for this function:

bool sp_instr_stmt::execute ( THD *  thd,
uint *  nextp 
)
virtual

Execute this instruction

Parameters
thdThread context
[out]nextpindex 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.
Returns
Error status.

Reimplemented from sp_lex_instr.

Definition at line 738 of file sp_instr.cc.

Here is the call graph for this function:

virtual void sp_instr_stmt::get_query ( String sql_query) const
inlinevirtual

Return the query string, which can be passed to the parser. I.e. the operation should return a valid SQL-statement query string.

Parameters
[out]sql_querySQL-statement query string.

Reimplemented from sp_lex_instr.

Definition at line 434 of file sp_instr.h.

virtual void sp_instr_stmt::invalidate ( )
inlinevirtual

Invalidate the object.

Implements sp_lex_instr.

Definition at line 431 of file sp_instr.h.

virtual bool sp_instr_stmt::is_invalid ( ) const
inlinevirtual
Return values
falseif the object (i.e. LEX-object) is valid and exec_core() can be just called.
trueif 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.

Implements sp_lex_instr.

Definition at line 428 of file sp_instr.h.

virtual bool sp_instr_stmt::on_after_expr_parsing ( THD *  thd)
inlinevirtual

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.

Parameters
thdThread context.
Returns
Error flag.

Reimplemented from sp_lex_instr.

Definition at line 437 of file sp_instr.h.


The documentation for this class was generated from the following files: