diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-08 11:09:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-08 11:09:49 +0300 |
commit | befb0bed68b555852e01859a846bf7ac40f15dbb (patch) | |
tree | 1698f0df44f4d5ad4ba1ff23314523179a94aac7 /sql/sql_union.cc | |
parent | a9bee9884aed7d9221bf028138349a1e7b5c984c (diff) | |
parent | f458b40f66f33521ad3e4f0d4ebcbbcc501c89ed (diff) | |
download | mariadb-git-befb0bed68b555852e01859a846bf7ac40f15dbb.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 13 |
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()) { |