From e66ba2e1d8c2d7950f135f2e55edd7b3ab8de658 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 17 Jul 2016 20:06:19 +0300 Subject: [PATCH] Fixed error with aggregate function anyHeavy [#METR-21691]. --- .../AggregateFunctionsMinMaxAny.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionsMinMaxAny.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionsMinMaxAny.h index 314f05b78e8..1f459e1195f 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionsMinMaxAny.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionsMinMaxAny.h @@ -582,6 +582,7 @@ struct AggregateFunctionAnyHeavyData : Data if (counter == 0) { this->change(column, row_num); + ++counter; return true; } else @@ -609,6 +610,18 @@ struct AggregateFunctionAnyHeavyData : Data return false; } + void write(WriteBuffer & buf, const IDataType & data_type) const + { + Data::write(buf, data_type); + writeBinary(counter, buf); + } + + void read(ReadBuffer & buf, const IDataType & data_type) + { + Data::read(buf, data_type); + readBinary(counter, buf); + } + static const char * name() { return "anyHeavy"; } };