summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-13 10:26:01 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-13 10:26:01 +0300
commit6e6318b29b446f76f01f2ef65d1460870b607d2a (patch)
tree8c22bb7661b77c91b28532ddd7c150d4bf010146 /sql/sql_lex.cc
parent450c017c2d9e490d92c949d5164b4a99b6b3f5db (diff)
parente262eb165c197083df9f4986ab54c5b2dcbd6290 (diff)
downloadmariadb-git-6e6318b29b446f76f01f2ef65d1460870b607d2a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c2bc8386404..fe4d086bd22 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2723,7 +2723,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);
@@ -2731,10 +2731,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
@@ -2756,7 +2760,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;
this->master_unit()->item->is_correlated= TRUE;
return FALSE;