ClickHouse/tests/queries/0_stateless/01395_limit_more_cases.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
789 B
Bash
Raw Normal View History

2020-07-12 22:23:21 +00:00
#!/usr/bin/env bash
# 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
$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