Commit 8ed5fde3 authored by Monty's avatar Monty Committed by Sergei Golubchik

bug in JOIN_TAB::cleanup() that caused freed memory to be accessed

parent 4193fa7a
...@@ -11472,14 +11472,16 @@ void JOIN_TAB::cleanup() ...@@ -11472,14 +11472,16 @@ void JOIN_TAB::cleanup()
} }
else else
{ {
TABLE_LIST *tmp= table->pos_in_table_list;
end_read_record(&read_record); end_read_record(&read_record);
table->pos_in_table_list->jtbm_subselect->cleanup(); tmp->jtbm_subselect->cleanup();
/* /*
The above call freed the materializedd temptable. Set it to NULL so The above call freed the materializedd temptable. Set it to NULL so
that we don't attempt to touch it if JOIN_TAB::cleanup() is invoked that we don't attempt to touch it if JOIN_TAB::cleanup() is invoked
multiple times (it may be) multiple times (it may be)
*/ */
table=NULL; tmp->table= NULL;
table= NULL;
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment