summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index a6377b319af..ed4b76026a0 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1444,7 +1444,7 @@ sp_rcontext *sp_head::rcontext_create(THD *thd, Field *ret_value,
bool switch_security_ctx)
{
if (!(m_flags & HAS_COLUMN_TYPE_REFS))
- return sp_rcontext::create(thd, m_pcont, ret_value, *defs);
+ return sp_rcontext::create(thd, this, m_pcont, ret_value, *defs);
sp_rcontext *res= NULL;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context *save_security_ctx;
@@ -1453,7 +1453,7 @@ sp_rcontext *sp_head::rcontext_create(THD *thd, Field *ret_value,
return NULL;
#endif
if (!defs->resolve_type_refs(thd))
- res= sp_rcontext::create(thd, m_pcont, ret_value, *defs);
+ res= sp_rcontext::create(thd, this, m_pcont, ret_value, *defs);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (switch_security_ctx)
m_security_ctx.restore_security_context(thd, save_security_ctx);
@@ -1590,10 +1590,6 @@ sp_head::execute_trigger(THD *thd,
goto err_with_cleanup;
}
-#ifndef DBUG_OFF
- nctx->sp= this;
-#endif
-
thd->spcont= nctx;
err_status= execute(thd, FALSE);
@@ -1714,10 +1710,6 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
*/
thd->restore_active_arena(&call_arena, &backup_arena);
-#ifndef DBUG_OFF
- nctx->sp= this;
-#endif
-
/* Pass arguments. */
for (arg_no= 0; arg_no < argcount; arg_no++)
{
@@ -1920,9 +1912,6 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
DBUG_RETURN(TRUE);
}
-#ifndef DBUG_OFF
- octx->sp= 0;
-#endif
thd->spcont= octx;
/* set callers_arena to thd, for upper-level function to work */
@@ -1935,9 +1924,6 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
thd->spcont= save_spcont;
DBUG_RETURN(TRUE);
}
-#ifndef DBUG_OFF
- nctx->sp= this;
-#endif
if (params > 0)
{