diff options
author | bell@sanja.is.com.ua <> | 2005-11-23 00:50:37 +0200 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2005-11-23 00:50:37 +0200 |
commit | 2bcd68973bb3ae278399a69b4642e76368edd31e (patch) | |
tree | bc5ba9cedbf44fad4c73c720d01700644e2e032e /sql/sql_class.cc | |
parent | debff3e632f039bf3f0fd9bcd05c02218524a537 (diff) | |
download | mariadb-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.cc')
-rw-r--r-- | sql/sql_class.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2917626ff35..32bbb456689 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1490,7 +1490,13 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u) { my_var *mv= gl++; if (mv->local) - (void)local_vars.push_back(new Item_splocal(mv->s, mv->offset)); + { + Item_splocal *var; + (void)local_vars.push_back(var= new Item_splocal(mv->s, mv->offset)); +#ifndef DEBUG_OFF + var->owner= mv->owner; +#endif + } else { Item_func_set_user_var *var= new Item_func_set_user_var(mv->s, item); |