mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
added test
This commit is contained in:
parent
d3157d910c
commit
192409ebd2
@ -0,0 +1,9 @@
|
||||
-
|
||||
Max query size exceeded
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
Max query size exceeded
|
||||
-
|
42
dbms/tests/queries/0_stateless/00612_http_max_query_size.sh
Executable file
42
dbms/tests/queries/0_stateless/00612_http_max_query_size.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
echo 'select 1' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL}/?max_query_size=8 -d @- 2>&1 | grep -o "Max query size exceeded"
|
||||
echo -
|
||||
echo 'select 1' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL}/?max_query_size=7 -d @- 2>&1 | grep -o "Max query size exceeded"
|
||||
|
||||
echo 'drop table if exists test.tab' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL} -d @-
|
||||
echo 'create table test.tab (key UInt64, val UInt64) engine = MergeTree order by key' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL} -d @-
|
||||
echo 'into test.tab values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)' | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}/?max_query_size=30&query=insert" -d @-
|
||||
echo 'select val from test.tab order by val' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL} -d @-
|
||||
echo 'drop table test.tab' | ${CLICKHOUSE_CURL} -sSg ${CLICKHOUSE_URL} -d @-
|
||||
|
||||
echo "
|
||||
import requests
|
||||
import os
|
||||
|
||||
url = os.environ['CLICKHOUSE_URL']
|
||||
if not url.startswith('http'):
|
||||
url = 'http://' + url
|
||||
q = 'select sum(number) from (select * from system.numbers limit 10000000) where number = 0'
|
||||
|
||||
def gen_data(q):
|
||||
yield q
|
||||
yield ''.join([' '] * (1024 - len(q)))
|
||||
|
||||
pattern = ''' or toString(number) = '{}'\n'''
|
||||
|
||||
for i in range(1, 4 * 1024):
|
||||
yield pattern.format(str(i).zfill(1024 - len(pattern) + 2))
|
||||
|
||||
s = requests.Session()
|
||||
resp = s.post(url + '/?max_query_size={}'.format(1 << 21), timeout=1, data=gen_data(q), stream=True,
|
||||
headers = {'Connection': 'close'})
|
||||
|
||||
for line in resp.iter_lines():
|
||||
print line
|
||||
" | python | grep -o "Max query size exceeded"
|
||||
echo -
|
||||
|
Loading…
Reference in New Issue
Block a user