Miscellaneous [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2018-01-10 04:45:28 +03:00
parent 94701c1d17
commit 8f0cf29a56

View File

@ -27,8 +27,8 @@ function check_only_exception() {
#(echo "$res")
#(echo "$res" | wc -l)
#(echo "$res" | grep -c "^$exception_pattern")
[[ `echo "$res" | wc -l` -eq 1 ]] || echo FAIL
[[ $(echo "$res" | grep -c "^$exception_pattern") -eq 1 ]] || echo FAIL
[[ `echo "$res" | wc -l` -eq 1 ]] || echo FAIL 1 $@
[[ $(echo "$res" | grep -c "^$exception_pattern") -eq 1 ]] || echo FAIL 2 $@
}
function check_last_line_exception() {
@ -36,12 +36,12 @@ function check_last_line_exception() {
#echo "$res" > res
#echo "$res" | wc -c
#echo "$res" | tail -n -2
[[ $(echo "$res" | tail -n -1 | grep -c "$exception_pattern") -eq 1 ]] || echo FAIL
[[ $(echo "$res" | head -n -1 | grep -c "$exception_pattern") -eq 0 ]] || echo FAIL
[[ $(echo "$res" | tail -n -1 | grep -c "$exception_pattern") -eq 1 ]] || echo FAIL 3 $@
[[ $(echo "$res" | head -n -1 | grep -c "$exception_pattern") -eq 0 ]] || echo FAIL 4 $@
}
function check_exception_handling() {
check_only_exception "max_result_bytes=1000" 1001
check_only_exception "max_result_bytes=1000" 1001
check_only_exception "max_result_bytes=1000&wait_end_of_query=1" 1001
check_only_exception "max_result_bytes=1048576&buffer_size=1048576&wait_end_of_query=0" 1048577
@ -69,7 +69,7 @@ function cmp_cli_and_http() {
$CLICKHOUSE_CLIENT -q "`query $1`" > ${CLICKHOUSE_TMP}/res1
ch_url "buffer_size=$2&wait_end_of_query=0" "$1" > ${CLICKHOUSE_TMP}/res2
ch_url "buffer_size=$2&wait_end_of_query=1" "$1" > ${CLICKHOUSE_TMP}/res3
cmp ${CLICKHOUSE_TMP}/res1 ${CLICKHOUSE_TMP}/res2 && cmp ${CLICKHOUSE_TMP}/res1 ${CLICKHOUSE_TMP}/res3 || echo FAIL
cmp ${CLICKHOUSE_TMP}/res1 ${CLICKHOUSE_TMP}/res2 && cmp ${CLICKHOUSE_TMP}/res1 ${CLICKHOUSE_TMP}/res3 || echo FAIL 5 $@
rm -rf ${CLICKHOUSE_TMP}/res1 ${CLICKHOUSE_TMP}/res2 ${CLICKHOUSE_TMP}/res3
}