1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for a bug record #307.

Very nasty bug.
It was caused by double free()-ing memory of join->select and 
join->quick. 

I was able to pinpoint it only after using Valgrind.

Plus better fix for bug with TMP_TABLE_PARAM.

Plus new constructor for SELECT_LEX.


mysql-test/r/innodb.result:
  Fix for a bug record #307.
  
  Very nasty bug.
  It was caused by double free()-ing memory of join->select and 
  join->quick. 
  
  I was able to pinpoint it only after using Valgrind.
mysql-test/t/innodb.test:
  Fix for a bug record #307.
  
  Very nasty bug.
  It was caused by double free()-ing memory of join->select and 
  join->quick. 
  
  I was able to pinpoint it only after using Valgrind.
sql/sql_lex.cc:
  Adding a usefull constructor
sql/sql_lex.h:
  Adding a usefull constructor which additionally required few more
  definitions.
sql/sql_select.cc:
  Fix for a bug record #307.
  
  Very nasty bug.
  It was caused by double free()-ing memory of join->select and 
  join->quick. 
  
  I was able to pinpoint it only after using Valgrind.
sql/sql_union.cc:
  Fixing bug #307.
  
  Also, a better fix for TMP_TABLE_PARAM bug.
  
  Also, use of the new constructor for SELECT_LEX.
This commit is contained in:
unknown
2003-04-21 21:03:32 +03:00
parent fa741bbc03
commit 8078280c76
6 changed files with 64 additions and 16 deletions

View File

@ -1281,9 +1281,18 @@ JOIN::cleanup(THD *thd)
JOIN_TAB *tab, *end;
for (tab= join_tab, end= tab+tables ; tab != end ; tab++)
{
delete tab->select;
delete tab->quick;
if (tab->select)
{
delete tab->select;
tab->select=0;
}
if (tab->quick)
{
delete tab->quick;
tab->quick=0;
}
x_free(tab->cache.buff);
tab->cache.buff= 0;
}
}
tmp_join->tmp_join= 0;
@ -3283,8 +3292,16 @@ join_free(JOIN *join, bool full)
{
for (tab=join->join_tab,end=tab+join->tables ; tab != end ; tab++)
{
delete tab->select;
delete tab->quick;
if (tab->select)
{
delete tab->select;
tab->select=0;
}
if (tab->quick)
{
delete tab->quick;
tab->quick=0;
}
x_free(tab->cache.buff);
tab->cache.buff= 0;
if (tab->table)