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:
@ -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)
|
||||
|
Reference in New Issue
Block a user