Merge pull request #43514 from ClickHouse/add_test_singledatavalue

Add another test for SingleDataValueString
This commit is contained in:
Alexander Tokmakov 2022-11-23 15:05:08 +03:00 committed by GitHub
commit 81abb2036e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -23,3 +23,8 @@
1M without 0 1048576 1M without 0 1048576
1M with 0 1048575 1M with 0 1048575
fuzz2 0123 4 fuzz2 0123 4
1 0
2 \0 1
3 \0\0\0\0 4
4 abrac\0dabra\0 12
abrac\0dabra\0 12

View File

@ -107,3 +107,14 @@ SELECT 'fuzz2', finalizeAggregation(CAST(unhex('04000000' || '30313233' || '01'
SELECT 'fuzz3', finalizeAggregation(CAST(unhex('04000000' || '30313233' || '00' || 'ffffffffffffffff'), 'AggregateFunction(argMax, String, UInt64)')) as x, length(x); -- { serverError CORRUPTED_DATA } SELECT 'fuzz3', finalizeAggregation(CAST(unhex('04000000' || '30313233' || '00' || 'ffffffffffffffff'), 'AggregateFunction(argMax, String, UInt64)')) as x, length(x); -- { serverError CORRUPTED_DATA }
SELECT 'fuzz4', finalizeAggregation(CAST(unhex('04000000' || '30313233' || '00'), 'AggregateFunction(argMax, String, UInt64)')) as x, length(x); -- { serverError CORRUPTED_DATA } SELECT 'fuzz4', finalizeAggregation(CAST(unhex('04000000' || '30313233' || '00'), 'AggregateFunction(argMax, String, UInt64)')) as x, length(x); -- { serverError CORRUPTED_DATA }
SELECT 'fuzz5', finalizeAggregation(CAST(unhex('0100000000000000000FFFFFFFF0'), 'AggregateFunction(argMax, UInt64, String)')); -- { serverError CORRUPTED_DATA } SELECT 'fuzz5', finalizeAggregation(CAST(unhex('0100000000000000000FFFFFFFF0'), 'AggregateFunction(argMax, UInt64, String)')); -- { serverError CORRUPTED_DATA }
drop table if exists aggr;
create table aggr (n int, s AggregateFunction(max, String)) engine=MergeTree order by n;
insert into aggr select 1, maxState('');
insert into aggr select 2, maxState('\0');
insert into aggr select 3, maxState('\0\0\0\0');
insert into aggr select 4, maxState('abrac\0dabra\0');
select n, maxMerge(s) as x, length(x) from aggr group by n order by n;
select maxMerge(s) as x, length(x) from aggr;
drop table aggr;