My Project
Public Member Functions
sp_instr_freturn Class Reference

#include <sp_instr.h>

Inheritance diagram for sp_instr_freturn:
sp_lex_instr sp_instr Sql_alloc sp_printable

List of all members.

Public Member Functions

 sp_instr_freturn (uint ip, LEX *lex, Item *expr_item, LEX_STRING expr_query, enum enum_field_types return_field_type)
virtual void print (String *str)
virtual uint opt_mark (sp_head *sp, List< sp_instr > *leads)
virtual bool exec_core (THD *thd, uint *nextp)
virtual bool is_invalid () const
virtual void invalidate ()
virtual bool on_after_expr_parsing (THD *thd)
virtual LEX_STRING get_expr_query () const

Detailed Description

sp_instr_freturn represents RETURN statement in stored functions.

Member Function Documentation

bool sp_instr_freturn::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).

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

Implements sp_lex_instr.

virtual LEX_STRING sp_instr_freturn::get_expr_query ( ) const [inline, virtual]
the expression query string. This string can not be passed directly to the parser as it is most likely not a valid SQL-statement.
as it can be seen in the get_query() implementation, get_expr_query() might return EMPTY_STR. EMPTY_STR means that no query-expression is available. That happens when class provides different implementation of get_query(). Strictly speaking, this is a drawback of the current class hierarchy.

Reimplemented from sp_lex_instr.

virtual void sp_instr_freturn::invalidate ( ) [inline, virtual]

Invalidate the object.

Implements sp_lex_instr.

virtual bool sp_instr_freturn::is_invalid ( ) const [inline, virtual]
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.

virtual bool sp_instr_freturn::on_after_expr_parsing ( THD *  thd) [inline, virtual]

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.

thdThread context.
Error flag.

Reimplemented from sp_lex_instr.

virtual uint sp_instr_freturn::opt_mark ( sp_head sp,
List< sp_instr > *  leads 
) [inline, virtual]

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 from sp_instr.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines