From e9912e2f7e7231f07b29ac865af59b5e22d8dec3 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 6 May 2023 02:19:58 +0200 Subject: [PATCH] Fix wrong assert --- src/AggregateFunctions/AggregateFunctionNothing.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/AggregateFunctions/AggregateFunctionNothing.h b/src/AggregateFunctions/AggregateFunctionNothing.h index 8491e8edfaa..8280d72c085 100644 --- a/src/AggregateFunctions/AggregateFunctionNothing.h +++ b/src/AggregateFunctions/AggregateFunctionNothing.h @@ -13,6 +13,11 @@ namespace DB { struct Settings; +namespace ErrorCodes +{ + extern const int INCORRECT_DATA; +} + /** Aggregate function that takes arbitrary number of arbitrary arguments and does nothing. */ @@ -69,7 +74,8 @@ public: { [[maybe_unused]] char symbol; readChar(symbol, buf); - assert(symbol == '\0'); + if (symbol != '\0') + throw Exception(ErrorCodes::INCORRECT_DATA, "Incorrect state of aggregate function 'nothing', it should contain exactly one zero byte."); } void insertResultInto(AggregateDataPtr __restrict, IColumn & to, Arena *) const override