1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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.
This commit is contained in:
Sinisa@sinisa.nasamreza.org
2003-04-21 21:03:32 +03:00
parent 8902b739e9
commit adb52cfc70
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)