From 6bf60dc388d879825fb645c487fe1e26b6d9de7b Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 17 Dec 2010 00:19:57 +0300 Subject: [PATCH] MWL#90: Post-merge fixes --- sql/sql_select.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e85faa5cfa0..5f252e38c7a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -243,6 +243,9 @@ static uint make_join_orderinfo(JOIN *join); Item_equal *find_item_equal(COND_EQUAL *cond_equal, Field *field, bool *inherited_fl); +JOIN_TAB *first_linear_tab(JOIN *join, bool after_const_tables); +JOIN_TAB *next_linear_tab(JOIN* join, JOIN_TAB* tab, bool include_bush_roots); + /** This handles SELECT with and without UNION. */ @@ -1582,9 +1585,12 @@ bool JOIN::setup_subquery_caches() if (conds) conds= conds->transform(&Item::expr_cache_insert_transformer, (uchar*) thd); - for (JOIN_TAB *tab= join_tab + const_tables; - tab < join_tab + tables ; - tab++) + for (JOIN_TAB *tab= first_linear_tab(this, TRUE); + tab; + tab= next_linear_tab(this, tab, TRUE)) + //for (JOIN_TAB *tab= join_tab + const_tables; + // tab < join_tab + tables ; + // tab++) { if (tab->select_cond) tab->select_cond=