From f33f931aff2fa9bafcee18889480659344e5ea7b Mon Sep 17 00:00:00 2001 From: BoloniniD Date: Tue, 13 Jul 2021 16:49:29 +0300 Subject: [PATCH] Some changes after test review --- .../0_stateless/01941_multiple_pipe_read.sh | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/tests/queries/0_stateless/01941_multiple_pipe_read.sh b/tests/queries/0_stateless/01941_multiple_pipe_read.sh index faf1486a697..c7bbdd00953 100644 --- a/tests/queries/0_stateless/01941_multiple_pipe_read.sh +++ b/tests/queries/0_stateless/01941_multiple_pipe_read.sh @@ -6,46 +6,27 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SAMPLE_FILE="$CURDIR/01941_sample_data.csv" STD_ERROR_CAPTURED="$CURDIR/01941_std_error_captured.log" +set -e + echo 'File generated:' ${CLICKHOUSE_LOCAL} -q "SELECT number, if(number in (4,6), 'AAA', 'BBB') from numbers(7) FORMAT CSV" --format_csv_delimiter=, >"$SAMPLE_FILE" cat "$SAMPLE_FILE" echo '******************' echo 'Attempt to read twice from a pipeline' -cat ${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * from table;' <<"$STD_ERROR_CAPTURED" -ret = $? -echo "Return code: $ret" -if [ "$ret" -eq "0" ]; then - echo "OK" -else - echo "FAILED: return code is not 0" -fi +${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * from table;' <<"$STD_ERROR_CAPTURED" -ret = $? -echo "Return code: $ret" -if [ "$ret" -eq "0" ]; then - echo "OK" -else - echo "FAILED: return code is not 0" -fi +${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * from table;' --file "$SAMPLE_FILE" echo '******************' -./clickhouse local --structure 'key String' -q 'select * from table; select * from table;' --file /tmp/foo echo 'Attempt to read twice from a pipe' -mkfifo /tmp/pipe +tpipe=$(mktemp -u) +mkfifo "$tpipe" echo "$SAMPLE_FILE" > /tmp/pipe & -${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * from table;' --file /tmp/pipe 2>"$STD_ERROR_CAPTURED" -ret = $? -echo "Return code: $ret" -if [ "$ret" -eq "0" ]; then - echo "FAILED" -else - echo "OK: cannot read from pipe twice" -fi +${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * from table;' --file /tmp/pipe + rm "$STD_ERROR_CAPTURED" "$SAMPLE_FILE"