ClickHouse/tests/queries/0_stateless/00984_parser_stack_overflow.sh

17 lines
864 B
Bash
Raw Normal View History

2019-08-10 16:40:57 +00:00
#!/usr/bin/env bash
CLICKHOUSE_CURL_TIMEOUT=30
2019-08-10 16:40:57 +00:00
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-08-01 00:51:12 +00:00
. "$CURDIR"/../shell_config.sh
2019-08-10 16:40:57 +00:00
2019-08-10 16:47:59 +00:00
# Too deep recursion
2019-08-10 16:51:09 +00:00
perl -e 'print "(" x 10000' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @- | grep -oF 'exceeded'
perl -e 'print "SELECT " . ("[" x 10000)' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @- | grep -oF 'exceeded'
perl -e 'print "SELECT " . ("([" x 5000)' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @- | grep -oF 'exceeded'
2019-08-10 17:08:14 +00:00
perl -e 'print "SELECT 1" . ("+1" x 10000)' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @- | grep -oF 'exceeded'
2019-08-10 16:47:59 +00:00
# But this is Ok
2019-08-10 16:51:09 +00:00
perl -e 'print "SELECT 1" . (",1" x 10000)' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @- | wc -c
2019-08-10 17:08:14 +00:00
perl -e 'print "SELECT 1" . (" OR 1" x 10000)' | $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" --data-binary @-