From 4ba6ce790ed6bda5c53c77ecfa8be5b53c47c9d2 Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 23 May 2016 18:41:00 -0500 Subject: [PATCH] MCOL-23 working_tpch1_compareLogOnly/onClauseJoins/bug4031.sql: A better solution --- dbcon/mysql/ha_calpont_execplan.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index ff8cdea32..8a3b24082 100755 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -1604,16 +1604,18 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp) // @bug5634, @bug5635. mark used derived col on derived table. // outer join inner table filter can not be moved in - // MariaDB 10.1: cached_table is never true for derived tables. - // Find another way to determine outer_join + // MariaDB 10.1: cached_table is never available for derived tables. + // Find the uncached object in table_list TABLE_LIST* tblList = ifp->context->table_list; while (tblList) { - if (strcasecmp(tblList->alias, ifp->table_name) == 0 && - !tblList->outer_join) + if (strcasecmp(tblList->alias, ifp->table_name) == 0) { - sc->derivedTable(derivedName); - sc->derivedRefCol(cols[j].get()); + if (!tblList->outer_join) + { + sc->derivedTable(derivedName); + sc->derivedRefCol(cols[j].get()); + } break; } tblList = tblList->next_local;