summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2005-06-10 16:14:01 +0200
committerunknown <pem@mysql.comhem.se>2005-06-10 16:14:01 +0200
commit03949f8ce8aba38e691bda665d277df8bc1fbee2 (patch)
treed62d5453cb34063af9f715acecb554a0ee41ef38 /sql/sp_rcontext.cc
parent8331a7cd3cce954d497bd4b128136e5c59d9f611 (diff)
downloadmariadb-git-03949f8ce8aba38e691bda665d277df8bc1fbee2.tar.gz
Post review and additional fix for BUG#10968: Stored procedures: crash if long loop.
Fixed valgrind complaints. This fixes the memory leak problems for procedured, and partially for functions. There's still a leak involving results from functions that turned out to be too involved, so it will be fixed separately. mysql-test/r/sp.result: Fixed some minor mistake (spotted while debugging). mysql-test/t/sp.test: Fixed some minor mistake (spotted while debugging). sql/item_func.cc: Moved Item_func_sp::cleanup() from item_func.h to ease debugging, and made a debug output come out right. sql/item_func.h: Moved Item_func_sp::cleanup() to item_func.cc to ease debugging. sql/sp_head.cc: Fixed valgrind problems with the previous memory leak fix (unit cleanup and putting result field in a differen mem_root), and removed prealloc flag from init_alloc_root() calls. sql/sp_rcontext.cc: New mem_root pointer used for return fields from functions. sql/sp_rcontext.h: New mem_root pointer used for return fields from functions.
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 2e79a1e2533..daca6b38b46 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -32,6 +32,7 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
: m_count(0), m_fsize(fsize), m_result(NULL), m_hcount(0), m_hsp(0),
m_hfound(-1), m_ccount(0)
{
+ callers_mem_root= NULL;
in_handler= FALSE;
m_frame= (Item **)sql_alloc(fsize * sizeof(Item*));
m_handler= (sp_handler_t *)sql_alloc(hmax * sizeof(sp_handler_t));