mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fix SIGSEGV for arrayCompact() with consts
arrayCompact() implements useDefaultImplementationForConstants() but it is a no-op for FunctionArrayMapped, fix this. CI report [1]: [1]: https://clickhouse-test-reports.s3.yandex.net/28890/baac2e561cfb05bc174f0bd25571e607d19c7463/fuzzer_asan/report.html#fail1
This commit is contained in:
parent
648d561242
commit
3c75844a79
@ -16,7 +16,6 @@ namespace ErrorCodes
|
||||
|
||||
struct ArrayCompactImpl
|
||||
{
|
||||
static bool useDefaultImplementationForConstants() { return true; }
|
||||
static bool needBoolean() { return false; }
|
||||
static bool needExpression() { return false; }
|
||||
static bool needOneArray() { return false; }
|
||||
@ -129,6 +128,7 @@ struct ArrayCompactImpl
|
||||
{
|
||||
ColumnPtr res;
|
||||
|
||||
mapped = mapped->convertToFullColumnIfConst();
|
||||
if (!(executeType< UInt8 >(mapped, array, res) ||
|
||||
executeType< UInt16>(mapped, array, res) ||
|
||||
executeType< UInt32>(mapped, array, res) ||
|
||||
|
@ -7,3 +7,5 @@
|
||||
[1,2,1]
|
||||
[2,1]
|
||||
[1,2,3,4,5]
|
||||
[0]
|
||||
[0]
|
||||
|
@ -7,3 +7,5 @@ select arrayCompact([1,1,2]);
|
||||
select arrayCompact([1,2,1]);
|
||||
select arrayCompact([2,1,1]);
|
||||
select arrayCompact([1,2,2,3,3,3,4,4,4,4,5,5,5,5,5]);
|
||||
SELECT arrayCompact(x->0, [NULL]);
|
||||
SELECT toString(arrayCompact(x->0, [NULL]));
|
||||
|
Loading…
Reference in New Issue
Block a user