My Project
|
#include <sp_instr.h>
Public Member Functions | |
sp_instr_set_case_expr (uint ip, LEX *lex, uint case_expr_id, Item *case_expr_item, LEX_STRING case_expr_query) | |
virtual void | print (String *str) |
virtual uint | opt_mark (sp_head *sp, List< sp_instr > *leads) |
virtual void | opt_move (uint dst, List< sp_branch_instr > *ibp) |
virtual void | set_destination (uint old_dest, uint new_dest) |
virtual void | backpatch (uint dest) |
virtual bool | exec_core (THD *thd, uint *nextp) |
virtual bool | on_after_expr_parsing (THD *thd) |
sp_instr_set_case_expr is used in the "simple CASE" implementation to evaluate and store the CASE-expression in the runtime context.
virtual void sp_instr_set_case_expr::backpatch | ( | uint | dest | ) | [inline, virtual] |
Update all instruction with the given label in the backpatch list to the specified instruction pointer.
dest | destination instruction pointer. |
Reimplemented from sp_lex_branch_instr.
bool sp_instr_set_case_expr::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).
thd | Thread context. |
nextp[out] | next instruction pointer |
Implements sp_lex_instr.
virtual bool sp_instr_set_case_expr::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.
thd | Thread context. |
Reimplemented from sp_lex_instr.
uint sp_instr_set_case_expr::opt_mark | ( | sp_head * | sp, |
List< sp_instr > * | leads | ||
) | [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_lex_branch_instr.
void sp_instr_set_case_expr::opt_move | ( | uint | dst, |
List< sp_branch_instr > * | ibp | ||
) | [virtual] |
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 from sp_lex_branch_instr.
virtual void sp_instr_set_case_expr::set_destination | ( | uint | old_dest, |
uint | new_dest | ||
) | [inline, virtual] |
Update the destination; used by the SP-instruction-optimizer.
old_dest | current (old) destination (instruction pointer). |
new_dest | new destination (instruction pointer). |
Reimplemented from sp_lex_branch_instr.