summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-02-12 03:10:26 +0200
committerunknown <bell@sanja.is.com.ua>2004-02-12 03:10:26 +0200
commit00392bf8b805f7e16fdb4c9d7c5e26490f6f7064 (patch)
treeec08c4d5b30f56815e8bfdacd0319bbcbd9f1abb /sql/sql_class.cc
parent9eb7c2ff63b16744ae3e7395b6b12369566ed283 (diff)
downloadmariadb-git-00392bf8b805f7e16fdb4c9d7c5e26490f6f7064.tar.gz
memory leacks in PS with subqueries fixed (adddition to fix of BUG#2462)
sql/item.h: mechanism to keep reference in cache array for row IN sql/item_cmpfunc.cc: mechanism to keep reference in cache array for row IN layout fixed sql/item_cmpfunc.h: mechanism to keep reference in cache array for row IN sql/item_subselect.cc: fixed memory pools swapping prevented deleting Item_in_optimizer cache in case of row IN subquery sql/mysql_priv.h: declarations of function moved to be useful in sql_class.h sql/sql_base.cc: keep fields expanded from '*' in statement memory pool sql/sql_class.cc: fixed restoring/backup of memory pool and list of items sql/sql_class.h: memory allocation methods moved to Statement memory pool substituting for preparing sql/sql_lex.cc: ref_pointer_array kept in statement memory sql/sql_lex.h: reinitialization of UNIT sql/sql_prepare.cc: memory allocation/swapping fixed tests/client_test.c: layout fixed
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index cfbf0385b6f..21d4949ad91 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1244,22 +1244,28 @@ void Statement::set_statement(Statement *stmt)
mem_root= stmt->mem_root;
}
+
void Statement::set_n_backup_item_arena(Statement *set, Statement *backup)
{
- backup->mem_root= mem_root;
- backup->free_list= free_list;
+ backup->set_item_arena(this);
set_item_arena(set);
}
+void Statement::restore_backup_item_arena(Statement *set, Statement *backup)
+{
+ set->set_item_arena(this);
+ set_item_arena(backup);
+ // reset backup mem_root to avoid its freeing
+ init_alloc_root(&backup->mem_root, 0, 0);
+}
+
void Statement::set_item_arena(Statement *set)
{
mem_root= set->mem_root;
free_list= set->free_list;
}
-
-
Statement::~Statement()
{
free_root(&mem_root, MYF(0));