summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2005-11-23 00:50:37 +0200
committerbell@sanja.is.com.ua <>2005-11-23 00:50:37 +0200
commit2bcd68973bb3ae278399a69b4642e76368edd31e (patch)
treebc5ba9cedbf44fad4c73c720d01700644e2e032e /sql/sql_class.h
parentdebff3e632f039bf3f0fd9bcd05c02218524a537 (diff)
downloadmariadb-git-2bcd68973bb3ae278399a69b4642e76368edd31e.tar.gz
Fix for BUG#13549 "Server crash with nested stored procedures
if inner routine has more local variables than outer one, and one of its last variables was used as argument to NOT operator". THD::spcont was non-0 when we were parsing stored routine/trigger definition during execution of another stored routine. This confused methods of Item_splocal and forced them use wrong runtime context. Fix ensures that we always have THD::spcont equal to zero during routine/trigger body parsing. This also allows to avoid problems with errors which occur during parsing and SQL exception handlers.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 7cbfc19123f..56cb606558d 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2075,6 +2075,13 @@ public:
class my_var : public Sql_alloc {
public:
LEX_STRING s;
+#ifndef DEBUG_OFF
+ /*
+ Routine to which this Item_splocal belongs. Used for checking if correct
+ runtime context is used for variable handling.
+ */
+ sp_head *owner;
+#endif
bool local;
uint offset;
enum_field_types type;