add tests

This commit is contained in:
Alexander Tokmakov 2019-07-18 18:54:58 +03:00
parent 6565d5c15f
commit 4c8c516208
2 changed files with 16 additions and 0 deletions

View File

@ -4,7 +4,11 @@ Hello "world" 789 2016-01-03
Hello\n world 100 2016-01-04
default 1 2019-06-19
default-eof 1 2019-06-19
0000-00-00 00:00:00
2016-01-01 01:02:03 1
2016-01-02 01:02:03 2
2017-08-15 13:15:01 3
1970-01-02 06:46:39 4
2016-01-01 01:02:03 NUL
2016-01-02 01:02:03 Nhello
\N \N

View File

@ -24,5 +24,17 @@ echo '"2016-01-01 01:02:03","1"
1502792101,"3"
99999,"4"' | $CLICKHOUSE_CLIENT --query="INSERT INTO csv FORMAT CSV";
echo '\N, \N' | $CLICKHOUSE_CLIENT --input_format_null_as_default=1 --query="INSERT INTO csv FORMAT CSV";
$CLICKHOUSE_CLIENT --query="SELECT * FROM csv ORDER BY s";
$CLICKHOUSE_CLIENT --query="DROP TABLE csv";
$CLICKHOUSE_CLIENT --query="CREATE TABLE csv_null (t Nullable(DateTime('Europe/Moscow')), s Nullable(String)) ENGINE = Memory";
echo 'NULL, NULL
"2016-01-01 01:02:03",NUL
"2016-01-02 01:02:03",Nhello' | $CLICKHOUSE_CLIENT --format_csv_unquoted_null_literal_as_null=1 --query="INSERT INTO csv_null FORMAT CSV";
$CLICKHOUSE_CLIENT --query="SELECT * FROM csv_null ORDER BY s NULLS LAST";
$CLICKHOUSE_CLIENT --query="DROP TABLE csv_null";