This commit is contained in:
Alexey Milovidov 2021-04-12 22:04:30 +03:00
parent e260b2a60a
commit d04541446c

View File

@ -4,8 +4,14 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh # shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh . "$CURDIR"/../shell_config.sh
# NOTE: since 'max_uri_size' doesn't affect the request itself, this test hardly depends on the default value of this setting (16Kb). # NOTE: since 'max_uri_size' doesn't affect the request itself, this test hardly depends on the default value of this setting (1 MiB).
LONG_REQUEST=$(python3 -c "print('&max_uri_size=1'*2000, end='')") # ~30K python3 -c "
print('${CLICKHOUSE_URL}', end='')
print('&hello=world'*100000, end='')
print('&query=SELECT+1')
" > "${CLICKHOUSE_TMP}/url.txt"
${CLICKHOUSE_CURL} -sSv "${CLICKHOUSE_URL}${LONG_REQUEST}&query=SELECT+1" 2>&1 | grep -Fc "HTTP/1.1 400 Bad Request" wget --input-file "${CLICKHOUSE_TMP}/url.txt" 2>&1 | grep -Fc "400: Bad Request"
rm "${CLICKHOUSE_TMP}/url.txt"