summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@oracle.com>2012-02-07 14:16:09 +0100
committerMartin Hansson <martin.hansson@oracle.com>2012-02-07 14:16:09 +0100
commit34cd261aaee2c5f63fd30e09e136bf56299ee142 (patch)
tree92f78d155bc71e95c1bffde7455d1ee782927af8 /sql/sql_select.cc
parent350e9168813e3bb04bcd7503a1701d28467e51b8 (diff)
downloadmariadb-git-34cd261aaee2c5f63fd30e09e136bf56299ee142.tar.gz
Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY
IS EXECUTED TWICE FROM P This bug is a duplicate of bug 12567331, which was pushed to the optimizer backporting tree on 2011-06-11. This is just a back-port of the fix. Both test cases are included as they differ somewhat.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 72c826ff32d..5f1efabfc97 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8947,11 +8947,9 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
}
/* Flatten nested joins that can be flattened. */
- TABLE_LIST *right_neighbor= NULL;
li.rewind();
while ((table= li++))
{
- bool fix_name_res= FALSE;
nested_join= table->nested_join;
if (nested_join && !table->on_expr)
{
@@ -8963,15 +8961,7 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
tbl->join_list= table->join_list;
}
li.replace(nested_join->join_list);
- /* Need to update the name resolution table chain when flattening joins */
- fix_name_res= TRUE;
- table= *li.ref();
- }
- if (fix_name_res)
- table->next_name_resolution_table= right_neighbor ?
- right_neighbor->first_leaf_for_name_resolution() :
- NULL;
- right_neighbor= table;
+ }
}
DBUG_RETURN(conds);
}