2020-07-12 22:23:21 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-03-16 16:53:12 +00:00
|
|
|
# Tags: no-fasttest
|
2020-07-12 22:23:21 +00:00
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2020-07-12 22:23:21 +00:00
|
|
|
|
|
|
|
SIZE=13
|
|
|
|
for OFFSET in {0..15}; do
|
|
|
|
for LIMIT in {0..15}; do
|
|
|
|
echo "SELECT
|
2024-08-23 09:20:40 +00:00
|
|
|
$OFFSET,
|
|
|
|
$LIMIT,
|
|
|
|
count() AS c,
|
|
|
|
min(number) AS first,
|
|
|
|
max(number) AS last,
|
2020-07-12 22:23:21 +00:00
|
|
|
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
|
2024-09-07 16:21:06 +00:00
|
|
|
done | $CLICKHOUSE_CLIENT --max_block_size 5
|