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.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 671acbc2a0c..0ab81a159be 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -794,6 +794,7 @@ static bool subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
splocal < sp_vars_uses.back(); splocal++)
{
Item *val;
+ (*splocal)->thd= thd; // fix_fields() is not yet done
/* append the text between sp ref occurences */
res|= qbuf.append(cur + prev_pos, (*splocal)->pos_in_query - prev_pos);
prev_pos= (*splocal)->pos_in_query + (*splocal)->m_name.length;