The world's most popular open source database
#include <sp_head.h>
Inheritance diagram for sp_instr_set_case_expr:


Public Member Functions | |
| sp_instr_set_case_expr (uint ip, sp_pcontext *ctx, uint case_expr_id, Item *case_expr, LEX *lex) | |
| virtual | ~sp_instr_set_case_expr () |
| virtual int | execute (THD *thd, uint *nextp) |
| virtual int | exec_core (THD *thd, uint *nextp) |
| virtual void | print (String *str) |
| virtual uint | opt_mark (sp_head *sp) |
| virtual void | opt_move (uint dst, List< sp_instr > *ibp) |
| virtual void | set_destination (uint old_dest, uint new_dest) |
Private Attributes | |
| uint | m_case_expr_id |
| Item * | m_case_expr |
| sp_lex_keeper | m_lex_keeper |
Definition at line 1136 of file sp_head.h.
| sp_instr_set_case_expr::sp_instr_set_case_expr | ( | uint | ip, | |
| sp_pcontext * | ctx, | |||
| uint | case_expr_id, | |||
| Item * | case_expr, | |||
| LEX * | lex | |||
| ) | [inline] |
Definition at line 1140 of file sp_head.h.
01142 : sp_instr_opt_meta(ip, ctx), 01143 m_case_expr_id(case_expr_id), m_case_expr(case_expr), 01144 m_lex_keeper(lex, TRUE) 01145 {}
| virtual sp_instr_set_case_expr::~sp_instr_set_case_expr | ( | ) | [inline, virtual] |
| int sp_instr_set_case_expr::exec_core | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Reimplemented from sp_instr.
Definition at line 3269 of file sp_head.cc.
References ER_OUT_OF_RESOURCES, m_case_expr, m_case_expr_id, sp_instr_opt_meta::m_cont_dest, sp_instr::m_ip, my_error(), and MYF.
03270 { 03271 int res= thd->spcont->set_case_expr(thd, m_case_expr_id, &m_case_expr); 03272 03273 if (res && 03274 !thd->spcont->get_case_expr(m_case_expr_id) && 03275 thd->spcont->found_handler_here()) 03276 { 03277 /* 03278 Failed to evaluate the value, the case expression is still not 03279 initialized, and a handler has been found. Set to NULL so we can continue. 03280 */ 03281 03282 Item *null_item= new Item_null(); 03283 03284 if (!null_item || 03285 thd->spcont->set_case_expr(thd, m_case_expr_id, &null_item)) 03286 { 03287 /* If this also failed, we have to abort. */ 03288 03289 sp_rcontext *spcont= thd->spcont; 03290 03291 thd->spcont= 0; /* Avoid handlers */ 03292 my_error(ER_OUT_OF_RESOURCES, MYF(0)); 03293 spcont->clear_handler(); 03294 thd->spcont= spcont; 03295 } 03296 *nextp= m_cont_dest; /* For continue handler */ 03297 } 03298 else 03299 *nextp= m_ip+1; 03300 03301 return res; 03302 }
Here is the call graph for this function:

| int sp_instr_set_case_expr::execute | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Implements sp_instr.
Definition at line 3260 of file sp_head.cc.
References DBUG_ENTER, DBUG_RETURN, m_lex_keeper, sp_lex_keeper::reset_lex_and_exec_core(), and TRUE.
03261 { 03262 DBUG_ENTER("sp_instr_set_case_expr::execute"); 03263 03264 DBUG_RETURN(m_lex_keeper.reset_lex_and_exec_core(thd, nextp, TRUE, this)); 03265 }
Here is the call graph for this function:

Reimplemented from sp_instr.
Definition at line 3319 of file sp_head.cc.
References sp_head::get_instr(), sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_cont_optdest, sp_instr::m_ip, sp_instr::marked, sp_head::opt_mark(), and sp_instr::opt_shortcut_jump().
03320 { 03321 sp_instr *i; 03322 03323 marked= 1; 03324 if ((i= sp->get_instr(m_cont_dest))) 03325 { 03326 m_cont_dest= i->opt_shortcut_jump(sp, this); 03327 m_cont_optdest= sp->get_instr(m_cont_dest); 03328 } 03329 sp->opt_mark(m_cont_dest); 03330 return m_ip+1; 03331 }
Here is the call graph for this function:

Reimplemented from sp_instr.
Definition at line 3334 of file sp_head.cc.
References sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_cont_optdest, sp_instr::m_ip, and List< T >::push_back().
03335 { 03336 if (m_cont_dest > m_ip) 03337 bp->push_back(this); // Forward 03338 else if (m_cont_optdest) 03339 m_cont_dest= m_cont_optdest->m_ip; // Backward 03340 m_ip= dst; 03341 }
Here is the call graph for this function:

| void sp_instr_set_case_expr::print | ( | String * | str | ) | [virtual] |
Implements sp_instr.
Definition at line 3306 of file sp_head.cc.
References m_case_expr, m_case_expr_id, sp_instr_opt_meta::m_cont_dest, Item::print(), String::qs_append(), String::reserve(), SP_INSTR_UINT_MAXLEN, and STRING_WITH_LEN.
03307 { 03308 /* set_case_expr (cont) id ... */ 03309 str->reserve(2*SP_INSTR_UINT_MAXLEN+18+32); // Add some extra for expr too 03310 str->qs_append(STRING_WITH_LEN("set_case_expr (")); 03311 str->qs_append(m_cont_dest); 03312 str->qs_append(STRING_WITH_LEN(") ")); 03313 str->qs_append(m_case_expr_id); 03314 str->qs_append(' '); 03315 m_case_expr->print(str); 03316 }
Here is the call graph for this function:

| virtual void sp_instr_set_case_expr::set_destination | ( | uint | old_dest, | |
| uint | new_dest | |||
| ) | [inline, virtual] |
Implements sp_instr_opt_meta.
Definition at line 1160 of file sp_head.h.
References sp_instr_opt_meta::m_cont_dest.
01161 { 01162 if (m_cont_dest == old_dest) 01163 m_cont_dest= new_dest; 01164 }
Item* sp_instr_set_case_expr::m_case_expr [private] |
uint sp_instr_set_case_expr::m_case_expr_id [private] |
1.4.7

