1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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
This commit is contained in:
unknown
2004-02-12 03:10:26 +02:00
parent 73c56ba8a5
commit 4b37cf65f7
12 changed files with 157 additions and 72 deletions

View File

@@ -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));