diff options
author | Georgi Kodinov <joro@sun.com> | 2009-09-28 10:21:25 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-09-28 10:21:25 +0300 |
commit | 7aa8cd7a117817c9627932b86be2e8e047bd033b (patch) | |
tree | 0600a41e4dca737e1cc98e02c2d8353e5ca4ff5b /sql/opt_sum.cc | |
parent | b21cd91780c72964b418c2a5cb65e8b71fd15485 (diff) | |
download | mariadb-git-7aa8cd7a117817c9627932b86be2e8e047bd033b.tar.gz |
Ported WL#3220 to mysql-next-mr.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r-- | sql/opt_sum.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 8e7265ba1ad..d995faf1ab6 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -355,10 +355,13 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result= 0; break; } + item_sum->set_aggregator (item_sum->with_distinct ? + Aggregator::DISTINCT_AGGREGATOR : + Aggregator::SIMPLE_AGGREGATOR); if (!count) { /* If count == 0, then we know that is_exact_count == TRUE. */ - ((Item_sum_min*) item_sum)->clear(); /* Set to NULL. */ + ((Item_sum_min*) item_sum)->aggregator_clear(); /* Set to NULL. */ } else ((Item_sum_min*) item_sum)->reset(); /* Set to the constant value. */ @@ -443,10 +446,13 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result= 0; break; } + item_sum->set_aggregator (item_sum->with_distinct ? + Aggregator::DISTINCT_AGGREGATOR : + Aggregator::SIMPLE_AGGREGATOR); if (!count) { /* If count != 1, then we know that is_exact_count == TRUE. */ - ((Item_sum_max*) item_sum)->clear(); /* Set to NULL. */ + ((Item_sum_max*) item_sum)->aggregator_clear(); /* Set to NULL. */ } else ((Item_sum_max*) item_sum)->reset(); /* Set to the constant value. */ |