summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_pcontext.cc9
-rw-r--r--sql/sp_pcontext.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index c83259c3926..3b60f0936f9 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -28,7 +28,7 @@
sp_pcontext::sp_pcontext(sp_pcontext *prev)
: Sql_alloc(), m_psubsize(0), m_csubsize(0), m_hsubsize(0),
- m_parent(prev), m_handlers(0)
+ m_handlers(0), m_parent(prev)
{
VOID(my_init_dynamic_array(&m_pvar, sizeof(sp_pvar_t *), 16, 8));
VOID(my_init_dynamic_array(&m_cond, sizeof(sp_cond_type_t *), 16, 8));
@@ -94,7 +94,7 @@ sp_pcontext::diff_handlers(sp_pcontext *ctx)
while (pctx && pctx != ctx)
{
- n+= pctx->max_handlers();
+ n+= pctx->m_handlers;
pctx= pctx->parent_context();
}
if (pctx)
@@ -109,12 +109,9 @@ sp_pcontext::diff_cursors(sp_pcontext *ctx)
sp_pcontext *pctx= this;
while (pctx && pctx != ctx)
- {
- n+= pctx->max_cursors();
pctx= pctx->parent_context();
- }
if (pctx)
- return n;
+ return ctx->current_cursors() - pctx->current_cursors();
return 0; // Didn't find ctx
}
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 6db62614aa5..36e4ed06aa7 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -275,6 +275,7 @@ protected:
uint m_psubsize;
uint m_csubsize;
uint m_hsubsize;
+ uint m_handlers; // No. of handlers in this context
private:
@@ -282,7 +283,6 @@ private:
uint m_poffset; // Variable offset for this context
uint m_coffset; // Cursor offset for this context
- uint m_handlers; // No. of handlers in this context
DYNAMIC_ARRAY m_pvar; // Parameters/variables
DYNAMIC_ARRAY m_cond; // Conditions