Tests for fixed issues #10846 and #7347

This commit is contained in:
Mikhail Filimonov 2020-07-07 12:00:39 +02:00
parent be85f9f98a
commit c8f51bdc8a
2 changed files with 21 additions and 0 deletions

View File

@ -18,3 +18,7 @@ Nullable(UInt8) \N 1 ok ok ok
Nullable(UInt8) \N 1 ok ok ok
Nullable(UInt8) \N 1 ok ok ok
\N 1 Nullable(Int8) \N ok
\N Nullable(Float64) 0
\N Nullable(Float64) 0
1
1

View File

@ -36,3 +36,20 @@ SELECT b_num, isNull(b_num), toTypeName(b_num), b_num = 0, if(b_num = 0, 'fail',
FROM (SELECT 1 k, toInt8(1) a_num) AS x
LEFT JOIN (SELECT 2 k, toInt8(1) b_num) AS y
USING (k);
-- test case from https://github.com/ClickHouse/ClickHouse/issues/7347
DROP TABLE IF EXISTS test_nullable_float_issue7347;
CREATE TABLE test_nullable_float_issue7347 (ne UInt64,test Nullable(Float64)) ENGINE = MergeTree() PRIMARY KEY (ne) ORDER BY (ne);
INSERT INTO test_nullable_float_issue7347 VALUES (1,NULL);
SELECT test, toTypeName(test), IF(test = 0, 1, 0) FROM test_nullable_float_issue7347;
WITH materialize(CAST(NULL, 'Nullable(Float64)')) AS test SELECT test, toTypeName(test), IF(test = 0, 1, 0);
DROP TABLE test_nullable_float_issue7347;
-- test case from https://github.com/ClickHouse/ClickHouse/issues/10846
SELECT if(isFinite(toUInt64OrZero(toNullable('123'))), 1, 0);
SELECT if(materialize(isFinite(toUInt64OrZero(toNullable('123')))), 1, 0);