summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.h
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2005-03-04 16:35:28 +0300
committerdlenev@brandersnatch.localdomain <>2005-03-04 16:35:28 +0300
commit5a6c7027f070aaa634051870d88bc185fed70878 (patch)
treeb4e76c9e63193526fe9a7fecdf02c5a44fe5c270 /sql/sp_rcontext.h
parent6611d3d2f8ea02886c4b507b7d15f5c3773431cc (diff)
downloadmariadb-git-5a6c7027f070aaa634051870d88bc185fed70878.tar.gz
Better approach for prelocking of tables for stored routines execution
and some SP-related cleanups. - We don't have separate stage for calculation of list of tables to be prelocked and doing implicit LOCK/UNLOCK any more. Instead we calculate this list at open_tables() and do implicit LOCK in lock_tables() (and UNLOCK in close_thread_tables()). Also now we support cases when same table (with same alias) is used several times in the same query in SP. - Cleaned up execution of SP. Moved all common code which handles LEX and does preparations before statement execution or complex expression evaluation to auxilary sp_lex_keeper class. Now all statements in SP (and corresponding instructions) that evaluate expression which can contain subquery have their own LEX.
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r--sql/sp_rcontext.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 8e818ab76d1..37d718048a0 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -25,6 +25,7 @@
struct sp_cond_type;
class sp_cursor;
struct sp_pvar;
+class sp_lex_keeper;
#define SP_HANDLER_NONE 0
#define SP_HANDLER_EXIT 1
@@ -164,7 +165,7 @@ class sp_rcontext : public Sql_alloc
restore_variables(uint fp);
void
- push_cursor(LEX *lex);
+ push_cursor(sp_lex_keeper *lex_keeper);
void
pop_cursors(uint count);
@@ -207,8 +208,8 @@ class sp_cursor : public Sql_alloc
{
public:
- sp_cursor(LEX *lex)
- : m_lex(lex), m_prot(NULL), m_isopen(0), m_current_row(NULL)
+ sp_cursor(sp_lex_keeper *lex_keeper)
+ : m_lex_keeper(lex_keeper), m_prot(NULL), m_isopen(0), m_current_row(NULL)
{
/* Empty */
}
@@ -220,7 +221,7 @@ public:
// We have split this in two to make it easy for sp_instr_copen
// to reuse the sp_instr::exec_stmt() code.
- LEX *
+ sp_lex_keeper *
pre_open(THD *thd);
void
post_open(THD *thd, my_bool was_opened);
@@ -240,7 +241,7 @@ public:
private:
MEM_ROOT m_mem_root; // My own mem_root
- LEX *m_lex;
+ sp_lex_keeper *m_lex_keeper;
Protocol_cursor *m_prot;
my_bool m_isopen;
my_bool m_nseof; // Original no_send_eof