#include <sp_head.h>
Inheritance diagram for sp_instr_copen:


Public Member Functions | |
| sp_instr_copen (uint ip, sp_pcontext *ctx, uint c) | |
| virtual | ~sp_instr_copen () |
| virtual int | execute (THD *thd, uint *nextp) |
| virtual int | exec_core (THD *thd, uint *nextp) |
| virtual void | print (String *str) |
Private Member Functions | |
| sp_instr_copen (const sp_instr_copen &) | |
| void | operator= (sp_instr_copen &) |
Private Attributes | |
| uint | m_cursor |
Definition at line 1020 of file sp_head.h.
| sp_instr_copen::sp_instr_copen | ( | const sp_instr_copen & | ) | [private] |
| sp_instr_copen::sp_instr_copen | ( | uint | ip, | |
| sp_pcontext * | ctx, | |||
| uint | c | |||
| ) | [inline] |
| virtual sp_instr_copen::~sp_instr_copen | ( | ) | [inline, virtual] |
| int sp_instr_copen::exec_core | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Reimplemented from sp_instr.
Definition at line 3105 of file sp_head.cc.
References m_cursor, sp_instr::m_ip, and sp_cursor::open().
03106 { 03107 sp_cursor *c= thd->spcont->get_cursor(m_cursor); 03108 int res= c->open(thd); 03109 *nextp= m_ip+1; 03110 return res; 03111 }
Here is the call graph for this function:

| int sp_instr_copen::execute | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Implements sp_instr.
Definition at line 3058 of file sp_head.cc.
References cleanup_items(), DBUG_ENTER, DBUG_RETURN, FALSE, sp_cursor::get_instr(), sp_cursor::get_lex_keeper(), m_cursor, and sp_lex_keeper::reset_lex_and_exec_core().
03059 { 03060 /* 03061 We don't store a pointer to the cursor in the instruction to be 03062 able to reuse the same instruction among different threads in future. 03063 */ 03064 sp_cursor *c= thd->spcont->get_cursor(m_cursor); 03065 int res; 03066 DBUG_ENTER("sp_instr_copen::execute"); 03067 03068 if (! c) 03069 res= -1; 03070 else 03071 { 03072 sp_lex_keeper *lex_keeper= c->get_lex_keeper(); 03073 Query_arena *old_arena= thd->stmt_arena; 03074 03075 /* 03076 Get the Query_arena from the cpush instruction, which contains 03077 the free_list of the query, so new items (if any) are stored in 03078 the right free_list, and we can cleanup after each open. 03079 */ 03080 thd->stmt_arena= c->get_instr(); 03081 res= lex_keeper->reset_lex_and_exec_core(thd, nextp, FALSE, this); 03082 /* Cleanup the query's items */ 03083 if (thd->stmt_arena->free_list) 03084 cleanup_items(thd->stmt_arena->free_list); 03085 thd->stmt_arena= old_arena; 03086 /* 03087 Work around the fact that errors in selects are not returned properly 03088 (but instead converted into a warning), so if a condition handler 03089 caught, we have lost the result code. 03090 */ 03091 if (!res) 03092 { 03093 uint dummy1, dummy2; 03094 03095 if (thd->spcont->found_handler(&dummy1, &dummy2)) 03096 res= -1; 03097 } 03098 /* TODO: Assert here that we either have an error or a cursor */ 03099 } 03100 DBUG_RETURN(res); 03101 }
Here is the call graph for this function:

| void sp_instr_copen::operator= | ( | sp_instr_copen & | ) | [private] |
| void sp_instr_copen::print | ( | String * | str | ) | [virtual] |
Implements sp_instr.
Definition at line 3114 of file sp_head.cc.
References sp_pcontext::find_cursor(), sp_instr::m_ctx, m_cursor, n, String::qs_append(), String::reserve(), SP_INSTR_UINT_MAXLEN, and STRING_WITH_LEN.
03115 { 03116 LEX_STRING n; 03117 my_bool found= m_ctx->find_cursor(m_cursor, &n); 03118 /* copen name@offset */ 03119 uint rsrv= SP_INSTR_UINT_MAXLEN+7; 03120 03121 if (found) 03122 rsrv+= n.length; 03123 if (str->reserve(rsrv)) 03124 return; 03125 str->qs_append(STRING_WITH_LEN("copen ")); 03126 if (found) 03127 { 03128 str->qs_append(n.str, n.length); 03129 str->qs_append('@'); 03130 } 03131 str->qs_append(m_cursor); 03132 }
Here is the call graph for this function:

uint sp_instr_copen::m_cursor [private] |
1.4.7
