From 03949f8ce8aba38e691bda665d277df8bc1fbee2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jun 2005 16:14:01 +0200 Subject: 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. --- sql/sp_rcontext.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sp_rcontext.cc') 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)); -- cgit v1.2.1