Commit a7c43a68 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

MDEV-9304: MariaDB crash with specific query

tmp_join may get its tables freed twice during JOIN cleanup. Set them to NULL
when the tmp_join is different than the current join.
parent 5269d378
...@@ -887,6 +887,12 @@ bool st_select_lex_unit::cleanup() ...@@ -887,6 +887,12 @@ bool st_select_lex_unit::cleanup()
join->tables_list= 0; join->tables_list= 0;
join->table_count= 0; join->table_count= 0;
join->top_join_tab_count= 0; join->top_join_tab_count= 0;
if (join->tmp_join && join->tmp_join != join)
{
join->tmp_join->tables_list= 0;
join->tmp_join->table_count= 0;
join->tmp_join->top_join_tab_count= 0;
}
} }
error|= fake_select_lex->cleanup(); error|= fake_select_lex->cleanup();
/* /*
......
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