summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b446a06ded1..3727e2db5a3 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -7133,10 +7133,13 @@ simple_ident:
sp_pvar_t *spv;
LEX *lex = Lex;
sp_pcontext *spc = lex->spcont;
-
if (spc && (spv = spc->find_pvar(&$1)))
- { /* We're compiling a stored procedure and found a variable */
- $$ = (Item*) new Item_splocal($1, spv->offset);
+ {
+ /* We're compiling a stored procedure and found a variable */
+ Item_splocal *splocal;
+ splocal= new Item_splocal($1, spv->offset, lex->tok_start_prev -
+ lex->sphead->m_tmp_query);
+ $$ = (Item*) splocal;
lex->variables_used= 1;
lex->safe_to_cache_query=0;
}