未验证 提交 0e103573 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #22565 from ClickHouse/fix-assert-arena

Fix assert in Arena when doing GROUP BY Array of Nothing of non-zero size.
......@@ -59,13 +59,16 @@ public:
StringRef serializeValueIntoArena(size_t /*n*/, Arena & arena, char const *& begin) const override
{
return { arena.allocContinue(0, begin), 0 };
/// Has to put one useless byte into Arena, because serialization into zero number of bytes is ambiguous.
char * res = arena.allocContinue(1, begin);
*res = 0;
return { res, 1 };
}
const char * deserializeAndInsertFromArena(const char * pos) override
{
++s;
return pos;
return pos + 1;
}
const char * skipSerializedInArena(const char * pos) const override
......
SELECT 1 GROUP BY emptyArrayToSingle(arrayFilter(x -> 1, []));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册