mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Fixed bug mdev-10773.
The temporary tables created for recursive table references should be closed in close_thread_tables(), because they might be used in the statements like ANALYZE WITH r AS (...) SELECT * from r where r is defined through recursion.
This commit is contained in:
@ -283,7 +283,14 @@ void select_union_recursive::cleanup()
|
||||
tab->file->extra(HA_EXTRA_RESET_STATE);
|
||||
tab->file->ha_delete_all_rows();
|
||||
}
|
||||
free_tmp_table(thd, tab);
|
||||
/*
|
||||
The table will be closed later in close_thread_tables(),
|
||||
because it might be used in the statements like
|
||||
ANALYZE WITH r AS (...) SELECT * from r
|
||||
where r is defined through recursion.
|
||||
*/
|
||||
tab->next= thd->rec_tables;
|
||||
thd->rec_tables= tab;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user