summaryrefslogtreecommitdiff
path: root/sql/item_xmlfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_xmlfunc.cc')
-rw-r--r--sql/item_xmlfunc.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 0b9e515a61f..63cc07fa34c 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -2632,6 +2632,10 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath)
sp_variable *spv;
const Sp_rcontext_handler *rh;
LEX *lex;
+ /*
+ We call lex->find_variable() rather than thd->lex->spcont->find_variable()
+ to make sure package body variables are properly supported.
+ */
if ((lex= thd->lex) &&
(spv= lex->find_variable(&name, &rh)))
{