summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-08 11:09:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-08 11:09:49 +0300
commitbefb0bed68b555852e01859a846bf7ac40f15dbb (patch)
tree1698f0df44f4d5ad4ba1ff23314523179a94aac7 /sql/sql_union.cc
parenta9bee9884aed7d9221bf028138349a1e7b5c984c (diff)
parentf458b40f66f33521ad3e4f0d4ebcbbcc501c89ed (diff)
downloadmariadb-git-befb0bed68b555852e01859a846bf7ac40f15dbb.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index b71b62b35ed..45b3c54460c 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -2030,6 +2030,19 @@ bool st_select_lex::cleanup()
delete join;
join= 0;
}
+ for (TABLE_LIST *tbl= get_table_list(); tbl; tbl= tbl->next_local)
+ {
+ if (tbl->is_recursive_with_table() &&
+ !tbl->is_with_table_recursive_reference())
+ {
+ /*
+ If query is killed before open_and_process_table() for tbl
+ is called then 'with' is already set, but 'derived' is not.
+ */
+ st_select_lex_unit *unit= tbl->with->spec;
+ error|= (bool) error | (uint) unit->cleanup();
+ }
+ }
for (SELECT_LEX_UNIT *lex_unit= first_inner_unit(); lex_unit ;
lex_unit= lex_unit->next_unit())
{