summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-02-01 15:48:02 -0800
committerIgor Babaev <igor@askmonty.org>2012-02-01 15:48:02 -0800
commit7b79d8a33f56d178c78209f910a0694807a63f8f (patch)
tree3d4a8131e8688c6599461bfce72bb87c718a53e4 /sql/opt_sum.cc
parent7ed15e6e50aec65560d8988fc5713f1f489b6616 (diff)
parent81690cf326e09799ca77d9f7bc5601905b706548 (diff)
downloadmariadb-git-7b79d8a33f56d178c78209f910a0694807a63f8f.tar.gz
Merge 5.2->5.3 in preparation for the release of mariadb-5.3.4-rc.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 08717142aa0..5298c57954d 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -623,7 +623,12 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
if (!cond)
DBUG_RETURN(TRUE);
Field *field= field_part->field;
- if (!(cond->used_tables() & field->table->map))
+ if (cond->used_tables() & OUTER_REF_TABLE_BIT)
+ {
+ DBUG_RETURN(FALSE);
+ }
+ if (!(cond->used_tables() & field->table->map) &&
+ test(cond->used_tables() & ~PSEUDO_TABLE_BITS))
{
/* Condition doesn't restrict the used table */
DBUG_RETURN(!cond->const_item());