summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-02-26 02:08:45 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-02-26 02:08:45 +0300
commitd290a6655385cb45cd68e763e8aa8e2b30637469 (patch)
treea411b70f98068df73c18c8c3cf51123ee3bbe2ad /sql/item_sum.cc
parent0c6d753708dfe07607ab6879b4832fe6ec5ddefb (diff)
downloadmariadb-git-d290a6655385cb45cd68e763e8aa8e2b30637469.tar.gz
MDEV-9634: Window function produces incorrect value
- Item_sum_count::remove() should check if the argument's value is NULL. - Window Function item must have its Item_window_func::split_sum_func called, - and it must call split_sum_func for aggregate's arguments (see the comment near Item_window_func::split_sum_func for explanation why)
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 91abea866b6..d9a92c7d216 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1538,8 +1538,9 @@ bool Item_sum_count::add()
void Item_sum_count::remove()
{
- /* TODO: Handle DECIMAL type */
DBUG_ASSERT(aggr->Aggrtype() == Aggregator::SIMPLE_AGGREGATOR);
+ if (aggr->arg_is_null(false))
+ return;
count--;
}