diff options
author | unknown <pem@mysql.comhem.se> | 2005-06-10 16:14:01 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2005-06-10 16:14:01 +0200 |
commit | 03949f8ce8aba38e691bda665d277df8bc1fbee2 (patch) | |
tree | d62d5453cb34063af9f715acecb554a0ee41ef38 /sql/item_func.h | |
parent | 8331a7cd3cce954d497bd4b128136e5c59d9f611 (diff) | |
download | mariadb-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/item_func.h')
-rw-r--r-- | sql/item_func.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index f0c7e25ad53..1ac1449760f 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1308,13 +1308,7 @@ public: virtual ~Item_func_sp() {} - void cleanup() - { - if (result_field) - delete result_field; - Item_func::cleanup(); - result_field= NULL; - } + void cleanup(); const char *func_name() const; @@ -1330,7 +1324,7 @@ public: { if (execute(&result_field)) return (longlong) 0; - return result_field->val_int(); + return result_field->val_int(); } double val_real() |