summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-01-14 01:26:20 +0200
committerMichael Widenius <monty@askmonty.org>2011-01-14 01:26:20 +0200
commitc2e219fb1ec88cefe33c5427ed2ce38ea9817bc3 (patch)
tree493bff58eacc690201501d5cf67255450bf8dd54 /sql/sql_select.cc
parentb0be3e2c6834d427c4e652a0203d166625871a35 (diff)
downloadmariadb-git-c2e219fb1ec88cefe33c5427ed2ce38ea9817bc3.tar.gz
Don't recalculate conditions that have already been checked.
This fixes the wrong result in tests like compress, join, join_cache, greedy_optimizer and select_pkeycache
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 415e4100a23..1e53785749f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -15045,6 +15045,8 @@ make_cond_for_table_from_pred(Item *root_cond, Item *cond,
bool retain_ref_cond)
{
+ if (used_table && !(cond->used_tables() & used_table))
+ return (COND*) 0; // Already checked
if (cond->type() == Item::COND_ITEM)
{
if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)