summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2005-05-23 23:43:43 +0200
committerunknown <pem@mysql.comhem.se>2005-05-23 23:43:43 +0200
commit9c79a9d69165aaba06ac6c7300b2216a372be204 (patch)
tree616f85ace18874855d5ab3b1a193fe32e82e096a /sql/sql_class.cc
parent982bd00d481333c44e6aee59fc667f8de155a612 (diff)
downloadmariadb-git-9c79a9d69165aaba06ac6c7300b2216a372be204.tar.gz
Fixed on BUG#6048: Stored procedure causes operating system reboot
Memory leak in locally evalutated expressions during SP execution fixed by reusing allocated item slots when possible. Note: No test case added, since the test is a stress test that tries to make the machine to run out of memory. Second attempt, now tested with debug build, valgrind build, max (optimized) build, with and without --debug, --vagrind and --ps-protocol. Errors in trigger and view test with --debug in debug build where present before this patch, and likewise for valgrind warnings for view test in valgrind build with --ps-protocol. sql/item.cc: Init rsize in Item (for SP item reusal). sql/item.h: Addes special new operator for reuse of Items, for SP internal use only. sql/sp_head.cc: Reuse items assigned internally in SPs when possible. sql/sp_rcontext.cc: Reuse items assigned internally in SPs when possible. Moved the local variable assignment here (from sp_head) to avoid duplicated code. sql/sp_rcontext.h: New arg to sp_rcontext::set_item_eval() (and some coding style). sql/sql_class.cc: Adjusted call to new set_item_eval().
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 2d5c4722164..2a500610479 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1746,7 +1746,8 @@ bool select_dumpvar::send_data(List<Item> &items)
{
if ((yy=var_li++))
{
- if (thd->spcont->set_item_eval(yy->get_offset(), it.ref(), zz->type))
+ if (thd->spcont->set_item_eval(current_thd,
+ yy->get_offset(), it.ref(), zz->type))
DBUG_RETURN(1);
}
}