summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorpem@mysql.comhem.se <>2004-07-21 14:53:09 +0200
committerpem@mysql.comhem.se <>2004-07-21 14:53:09 +0200
commitc0ae84125825e5fb28b4872008ce984e70ae8166 (patch)
tree9c4a5fbacf4edbc4b2994c620f5d4a69b951f7d6 /sql/sp_rcontext.cc
parent108be666d98c25108d4209cc582798a1e25d0b0a (diff)
downloadmariadb-git-c0ae84125825e5fb28b4872008ce984e70ae8166.tar.gz
Fixed BUG#2653: Undeclared variables not detected in stored procedures.
We now get an run-time error instead of a crash (although a slightly misleading error message, but it's an improvement).
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 0b2b20fe3b3..7fa44f217f6 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -40,12 +40,19 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
m_saved.empty();
}
-void
+int
sp_rcontext::set_item_eval(uint idx, Item *i, enum_field_types type)
{
extern Item *sp_eval_func_item(THD *thd, Item *it, enum_field_types type);
+ Item *it= sp_eval_func_item(current_thd, i, type);
- set_item(idx, sp_eval_func_item(current_thd, i, type));
+ if (! it)
+ return -1;
+ else
+ {
+ set_item(idx, it);
+ return 0;
+ }
}
int