diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-14 11:35:39 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-14 11:35:39 +0300 |
commit | 6c3e860cbf36831c118f6ea183acbbeb3c889bed (patch) | |
tree | 8585545cc8a95e790c01eb164f74685674f9f23b /sql/sql_lex.cc | |
parent | 9ff737b25edbcb0c74d9d312f6da702e7d993e88 (diff) | |
parent | 5008171b05e0d3b8b5f4af312b94a312281e77c7 (diff) | |
download | mariadb-git-6c3e860cbf36831c118f6ea183acbbeb3c889bed.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 02652dd095c..ce5f78b84ad 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3344,7 +3344,7 @@ void st_select_lex_unit::exclude_tree() */ bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last, - Item *dependency) + Item_ident *dependency) { DBUG_ASSERT(this != last); @@ -3352,10 +3352,14 @@ bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last, /* Mark all selects from resolved to 1 before select where was found table as depended (of select where was found table) + + We move by name resolution context, bacause during merge can some select + be excleded from SELECT tree */ - SELECT_LEX *s= this; + Name_resolution_context *c= &this->context; do { + SELECT_LEX *s= c->select_lex; if (!(s->uncacheable & UNCACHEABLE_DEPENDENT_GENERATED)) { // Select is dependent of outer select @@ -3377,7 +3381,7 @@ bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last, if (subquery_expr && subquery_expr->mark_as_dependent(thd, last, dependency)) return TRUE; - } while ((s= s->outer_select()) != last && s != 0); + } while ((c= c->outer_context) != NULL && (c->select_lex != last)); is_correlated= TRUE; master_unit()->item->is_correlated= TRUE; return FALSE; |