mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-4536, MDEV-4042
- Make JOIN::cleanup(true) also work correctly when the query is KILLed after join optimization was started but before a query plan was produced
This commit is contained in:
@@ -10643,10 +10643,15 @@ void JOIN::cleanup(bool full)
|
|||||||
w/o tables: they don't have some members initialized and
|
w/o tables: they don't have some members initialized and
|
||||||
WALK_OPTIMIZATION_TABS may not work correctly for them.
|
WALK_OPTIMIZATION_TABS may not work correctly for them.
|
||||||
*/
|
*/
|
||||||
|
enum enum_exec_or_opt tabs_kind;
|
||||||
|
if (first_breadth_first_tab(this, WALK_OPTIMIZATION_TABS))
|
||||||
|
tabs_kind= WALK_OPTIMIZATION_TABS;
|
||||||
|
else
|
||||||
|
tabs_kind= WALK_EXECUTION_TABS;
|
||||||
if (table_count)
|
if (table_count)
|
||||||
{
|
{
|
||||||
for (tab= first_breadth_first_tab(this, WALK_OPTIMIZATION_TABS); tab;
|
for (tab= first_breadth_first_tab(this, tabs_kind); tab;
|
||||||
tab= next_breadth_first_tab(this, WALK_OPTIMIZATION_TABS, tab))
|
tab= next_breadth_first_tab(this, tabs_kind, tab))
|
||||||
{
|
{
|
||||||
tab->cleanup();
|
tab->cleanup();
|
||||||
}
|
}
|
||||||
|
@@ -1308,6 +1308,12 @@ public:
|
|||||||
pre_sort_join_tab= NULL;
|
pre_sort_join_tab= NULL;
|
||||||
emb_sjm_nest= NULL;
|
emb_sjm_nest= NULL;
|
||||||
sjm_lookup_tables= 0;
|
sjm_lookup_tables= 0;
|
||||||
|
/*
|
||||||
|
The following is needed because JOIN::cleanup(true) may be called for
|
||||||
|
joins for which JOIN::optimize was aborted with an error before a proper
|
||||||
|
query plan was produced
|
||||||
|
*/
|
||||||
|
table_access_tabs= NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int prepare(Item ***rref_pointer_array, TABLE_LIST *tables, uint wind_num,
|
int prepare(Item ***rref_pointer_array, TABLE_LIST *tables, uint wind_num,
|
||||||
|
Reference in New Issue
Block a user