summaryrefslogtreecommitdiffstats
path: root/sql/sp.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sql/sp.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index f51851d1..32353435 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -2731,7 +2731,13 @@ sp_update_stmt_used_routines(THD *thd, Query_tables_list *prelocking_ctx,
for (uint i=0 ; i < src->records ; i++)
{
Sroutine_hash_entry *rt= (Sroutine_hash_entry *)my_hash_element(src, i);
- (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
+ DBUG_ASSERT(thd->active_stmt_arena_to_use()->
+ is_stmt_prepare_or_first_stmt_execute() ||
+ thd->active_stmt_arena_to_use()->
+ is_conventional() ||
+ thd->active_stmt_arena_to_use()->state ==
+ Query_arena::STMT_SP_QUERY_ARGUMENTS);
+ (void)sp_add_used_routine(prelocking_ctx, thd->active_stmt_arena_to_use(),
&rt->mdl_request.key, rt->m_handler,
belong_to_view);
}
@@ -2757,7 +2763,7 @@ void sp_update_stmt_used_routines(THD *thd, Query_tables_list *prelocking_ctx,
TABLE_LIST *belong_to_view)
{
for (Sroutine_hash_entry *rt= src->first; rt; rt= rt->next)
- (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
+ (void)sp_add_used_routine(prelocking_ctx, thd->active_stmt_arena_to_use(),
&rt->mdl_request.key, rt->m_handler,
belong_to_view);
}