Merge pull request #49581 from ClickHouse/fix-fuzz-nothing

Fix wrong assert
This commit is contained in:
Alexey Milovidov 2023-05-06 18:05:40 +03:00 committed by GitHub
commit d86bda3054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1 @@
SELECT CAST('\x01\x00' AS AggregateFunction(nothingArrayIf, Array(Nullable(Nothing)), Nullable(Nothing))); -- { serverError INCORRECT_DATA }