summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-03-20 11:51:09 -0700
committerunknown <igor@olga.mysql.com>2007-03-20 11:51:09 -0700
commit91f7f3181670523aa657420ae47d1d20fcd07aea (patch)
tree0fa99f2f4100ca4e7de6bbd904c82993d212493b /sql/item_sum.cc
parent3798a7d5008f8f569f779f096b7fc1e1cfac1031 (diff)
downloadmariadb-git-91f7f3181670523aa657420ae47d1d20fcd07aea.tar.gz
Fixed bug #27257: queries containing subqueries with COUNT(*)
aggregated in outer context returned wrong results. This happened only if the subquery did not contain any references to outer fields. As there were no references to outer fields the subquery erroneously was taken for non-correlated one. Now any set function aggregated in outer context makes the subquery correlated. mysql-test/r/subselect.result: Added a test case for bug #27257. mysql-test/t/subselect.test: Added a test case for bug #27257.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 41f0dd6496b..a8ffa200102 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -267,6 +267,7 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref)
sl= sl->master_unit()->outer_select() )
sl->master_unit()->item->with_sum_func= 1;
}
+ thd->lex->current_select->mark_as_dependent(aggr_sl);
return FALSE;
}