summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
commit49c853fb948aeaeb5c7e3f02da3f14da51ee4100 (patch)
tree8c3d487a02209cc0c6f126144f1340fc5897d527 /sql/table.cc
parentae18a28500974351cf42fa3cac67c83e0647d510 (diff)
parent4c87f727734955f9e4a0ffde25aae4d43ec0b2a5 (diff)
downloadmariadb-git-49c853fb948aeaeb5c7e3f02da3f14da51ee4100.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc42
1 files changed, 20 insertions, 22 deletions
diff --git a/sql/table.cc b/sql/table.cc
index a9b525bd25f..053269ab435 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -5111,7 +5111,8 @@ TABLE *TABLE_LIST::get_real_join_table()
TABLE_LIST *tbl= this;
while (tbl->table == NULL || tbl->table->reginfo.join_tab == NULL)
{
- if (tbl->view == NULL && tbl->derived == NULL)
+ if ((tbl->view == NULL && tbl->derived == NULL) ||
+ tbl->is_materialized_derived())
break;
/* we do not support merging of union yet */
DBUG_ASSERT(tbl->view == NULL ||
@@ -5120,28 +5121,25 @@ TABLE *TABLE_LIST::get_real_join_table()
tbl->derived->first_select()->next_select() == NULL);
{
- List_iterator_fast<TABLE_LIST> ti;
+ List_iterator_fast<TABLE_LIST>
+ ti(tbl->view != NULL ?
+ tbl->view->select_lex.top_join_list :
+ tbl->derived->first_select()->top_join_list);
+ for (;;)
{
- List_iterator_fast<TABLE_LIST>
- ti(tbl->view != NULL ?
- tbl->view->select_lex.top_join_list :
- tbl->derived->first_select()->top_join_list);
- for (;;)
- {
- tbl= NULL;
- /*
- Find left table in outer join on this level
- (the list is reverted).
- */
- for (TABLE_LIST *t= ti++; t; t= ti++)
- tbl= t;
- if (!tbl)
- return NULL; // view/derived with no tables
- if (!tbl->nested_join)
- break;
- /* go deeper if we've found nested join */
- ti= tbl->nested_join->join_list;
- }
+ tbl= NULL;
+ /*
+ Find left table in outer join on this level
+ (the list is reverted).
+ */
+ for (TABLE_LIST *t= ti++; t; t= ti++)
+ tbl= t;
+ if (!tbl)
+ return NULL; // view/derived with no tables
+ if (!tbl->nested_join)
+ break;
+ /* go deeper if we've found nested join */
+ ti= tbl->nested_join->join_list;
}
}
}