Skip to content

Commit 8ed5fde

Browse files
montywivuvova
authored andcommitted
bug in JOIN_TAB::cleanup() that caused freed memory to be accessed
1 parent 4193fa7 commit 8ed5fde

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/sql_select.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11472,14 +11472,16 @@ void JOIN_TAB::cleanup()
1147211472
}
1147311473
else
1147411474
{
11475+
TABLE_LIST *tmp= table->pos_in_table_list;
1147511476
end_read_record(&read_record);
11476-
table->pos_in_table_list->jtbm_subselect->cleanup();
11477+
tmp->jtbm_subselect->cleanup();
1147711478
/*
1147811479
The above call freed the materializedd temptable. Set it to NULL so
1147911480
that we don't attempt to touch it if JOIN_TAB::cleanup() is invoked
1148011481
multiple times (it may be)
1148111482
*/
11482-
table=NULL;
11483+
tmp->table= NULL;
11484+
table= NULL;
1148311485
}
1148411486
DBUG_VOID_RETURN;
1148511487
}

0 commit comments

Comments
 (0)