summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorOle John Aske <ole.john.aske@oracle.com>2011-01-13 10:20:45 +0100
committerOle John Aske <ole.john.aske@oracle.com>2011-01-13 10:20:45 +0100
commitba38eef6dc48500182da039b77eb0ff51c52a087 (patch)
treedf093f530b4fdbfd32ace6722bef69a6784d4b1e /sql/sql_select.cc
parentef331b0c42a9fbad8417d0f9fbec9a6ee797b31b (diff)
downloadmariadb-git-ba38eef6dc48500182da039b77eb0ff51c52a087.tar.gz
Fix for bug#58134: 'Incorrectly condition pushdown inside subquery to NDB engine'
An incorrect 'table_map' containing both the table itself, and possible any outer-refs if this was the last table in the subquery, was presented to make_cond_for_table(). As a pushed condition is only able to refer column from the table the condition is pushed to, nothing else than columns from the table itself (tab->table->map) may be refered in the pushed condition constructed by 'push_cond= make_cond_for_table()'. Also fix a minor 'copy and paste' bug in a comment inside make_cond_for_table(). No testcase is possible on mainbranch as the NDB engine is not available (yet) on mysql >= 5.5
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 91ce31636b4..26216225c3f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6480,7 +6480,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN)
{
COND *push_cond=
- make_cond_for_table(tmp, current_map, current_map);
+ make_cond_for_table(tmp, tab->table->map, tab->table->map);
if (push_cond)
{
/* Push condition to handler */
@@ -13099,7 +13099,7 @@ make_cond_for_table(COND *cond, table_map tables, table_map used_table)
new_cond->argument_list()->push_back(fix);
}
/*
- Item_cond_and do not need fix_fields for execution, its parameters
+ Item_cond_or do not need fix_fields for execution, its parameters
are fixed or do not need fix_fields, too
*/
new_cond->quick_fix_field();