From 9e8b28131e6a0d272650d1d5268bc767612b1004 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 15 Sep 2015 00:09:33 +0300 Subject: [PATCH] dbms: fixed error [#METR-17536]. --- dbms/include/DB/Columns/ColumnAggregateFunction.h | 4 ++-- dbms/src/Interpreters/Aggregator.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbms/include/DB/Columns/ColumnAggregateFunction.h b/dbms/include/DB/Columns/ColumnAggregateFunction.h index 0fc394419f9..68bf2970a4f 100644 --- a/dbms/include/DB/Columns/ColumnAggregateFunction.h +++ b/dbms/include/DB/Columns/ColumnAggregateFunction.h @@ -100,9 +100,9 @@ public: arenas.push_back(arena_); } - ColumnPtr convertToValues() + ColumnPtr convertToValues() const { - IAggregateFunction * function = holder->func; + const IAggregateFunction * function = holder->func; ColumnPtr res = function->getReturnType()->createColumn(); IColumn & column = *res; res->reserve(getData().size()); diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index ce615fb53d4..56ea0ea896e 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -1756,7 +1756,7 @@ Block Aggregator::mergeBlocks(BlocksList & blocks, bool final) for (const auto & block : merged_blocks) { - if (block && !block.info.is_overflows) + if (block && block.rowsInFirstColumn() && !block.info.is_overflows) has_nonempty_nonoverflows = true; else if (block.info.is_overflows) has_overflows = true; @@ -1777,7 +1777,7 @@ Block Aggregator::mergeBlocks(BlocksList & blocks, bool final) { for (auto it = merged_blocks.begin(); it != merged_blocks.end(); ++it) { - if (!*it) + if (!*it || it->rowsInFirstColumn() == 0) { merged_blocks.erase(it); break;