Test style fixed

This commit is contained in:
Mikhail Korotov 2020-01-31 21:25:21 +03:00
parent 757247cbd5
commit f170a19eb3
3 changed files with 13 additions and 25 deletions

View File

@ -1,2 +1,4 @@
OK
OK
1,"hello"
2,"world"
1,"hello"
2,"world"

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test_01073_crlf_in_output_csv_format;"
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test_01073_crlf_in_output_csv_format (value UInt8, word String) ENGINE = MergeTree() ORDER BY value;"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test_01073_crlf_in_output_csv_format VALUES (1, 'hello'), (2, 'world');"
if [[ `${CLICKHOUSE_CLIENT} --output_format_csv_crlf_end_of_line=0 --query "SELECT * FROM test_01073_crlf_in_output_csv_format FORMAT CSV;"`="1,\"hello\"\n2,\"world\"\n" ]]; then
echo "OK"
else
echo "WA"
fi
if [[ `${CLICKHOUSE_CLIENT} --output_format_csv_crlf_end_of_line=1 --query "SELECT * FROM test_01073_crlf_in_output_csv_format FORMAT CSV;"`="1,\"hello\"\r\n2,\"world\"\r\n" ]]; then
echo "OK"
else
echo "WA"
fi
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test_01073_crlf_in_output_csv_format;"

View File

@ -0,0 +1,9 @@
DROP TABLE IF EXISTS test_01073_crlf_in_output_csv_format;
CREATE TABLE test_01073_crlf_in_output_csv_format (value UInt8, word String) ENGINE = MergeTree() ORDER BY value;
INSERT INTO test_01073_crlf_in_output_csv_format VALUES (1, 'hello'), (2, 'world');
SET output_format_csv_crlf_end_of_line = 1;
SELECT * FROM test_01073_crlf_in_output_csv_format FORMAT CSV;
SET output_format_csv_crlf_end_of_line = 0;
SELECT * FROM test_01073_crlf_in_output_csv_format FORMAT CSV;
DROP TABLE IF EXISTS test_01073_crlf_in_output_csv_format;