mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Better test
This commit is contained in:
parent
8f0ec09372
commit
f6f8421c2f
@ -254,3 +254,4 @@
|
||||
15 13 0 0 0 0 0 0
|
||||
15 14 0 0 0 0 0 0
|
||||
15 15 0 0 0 0 0 0
|
||||
0 0 0
|
||||
|
@ -16,3 +16,20 @@ for OFFSET in {0..15}; do
|
||||
"
|
||||
done
|
||||
done | $CLICKHOUSE_CLIENT -n --max_block_size 5
|
||||
|
||||
# Randomized test
|
||||
|
||||
ITERATIONS=1000
|
||||
for i in $(seq $ITERATIONS); do
|
||||
SIZE=$(($RANDOM % 100))
|
||||
OFFSET=$(($RANDOM % 111))
|
||||
LIMIT=$(($RANDOM % 111))
|
||||
|
||||
echo "WITH count() AS c, min(number) AS first, max(number) AS last
|
||||
SELECT
|
||||
throwIf(first != ($OFFSET < $SIZE AND $LIMIT > 0 ? $OFFSET : 0)),
|
||||
throwIf(last != ($OFFSET < $SIZE AND $LIMIT > 0 ? least($SIZE - 1, $OFFSET + $LIMIT - 1) : 0)),
|
||||
throwIf((c != 0 OR first != 0 OR last != 0) AND (c != last - first + 1))
|
||||
FROM (SELECT * FROM numbers($SIZE) LIMIT $OFFSET, $LIMIT);
|
||||
"
|
||||
done | $CLICKHOUSE_CLIENT -n --max_block_size $(($RANDOM % 20)) | uniq
|
||||
|
Loading…
Reference in New Issue
Block a user