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.yy12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3adc2801270..14b7a5589e1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4394,9 +4394,11 @@ sp_fetch_list:
LEX *lex= Lex;
sp_head *sp= lex->sphead;
sp_pcontext *spc= lex->spcont;
- sp_variable *spv;
+ sp_variable *spv= likely(spc != NULL)
+ ? spc->find_variable(&$1, false)
+ : NULL;
- if (unlikely(!spc || !(spv = spc->find_variable(&$1, false))))
+ if (unlikely(!spv))
my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $1.str));
/* An SP local variable */
@@ -4408,9 +4410,11 @@ sp_fetch_list:
LEX *lex= Lex;
sp_head *sp= lex->sphead;
sp_pcontext *spc= lex->spcont;
- sp_variable *spv;
+ sp_variable *spv= likely(spc != NULL)
+ ? spc->find_variable(&$3, false)
+ : NULL;
- if (unlikely(!spc || !(spv = spc->find_variable(&$3, false))))
+ if (unlikely(!spv))
my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $3.str));
/* An SP local variable */