ClickHouse/tests/sqllogic/self-test/test.test

146 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-04-16 10:11:35 +00:00
onlyif ClickHouse
statement ok
CREATE TABLE t1(a INTEGER, b INTEGER) ENGINE = MergeTree() PRIMARY KEY tuple()
skipif ClickHouse
statement ok
CREATE TABLE t1(a INTEGER, b INTEGER)
statement ok
INSERT INTO t1(a,b) VALUES(1,2)
statement ok
INSERT INTO t1(a,b) VALUES(3,4)
statement ok
INSERT INTO t1(a,b) VALUES(5,6)
# just ok request
query II nosort
SELECT a, b
FROM t1
ORDER BY 2,1
----
# will fail and write exception as a result
query II nosort
SELECT a, c
FROM t1
ORDER BY 2,1
----
# expect to fail
onlyif ClickHouse
query error UNKNOWN_IDENTIFIER
SELECT a, c FROM t1
----
# expect to fail
onlyif sqlite
query error No such column
SELECT a, c FROM t1
----
# expect to fail in a different way
query error expect to fail in a different way
SELECT a, c FROM t1
----
# print empty as (empty)
query T nosort
SELECT ''
----
(empty)
# without result set
query T nosort
SELECT ''
----
# without result and saparator
query T nosort
SELECT ''
# just ok with REAL
query R nosort
SELECT -1.0
----
-1.000
# just ok with signed
query I nosort
SELECT -1
----
-1
# just ok
query RI nosort
SELECT 1.0, 1
----
1.000 1
# mess with columns count
query R nosort
SELECT 1.0, 1
----
1.000 1
# mess with colums count
query RT nosort
SELECT 1.0
----
1.000
# empty result set
query II nosort
select a, b from t1 where a = b
----
# precise is 3 digits
query R nosort
SELECT 1.0013
----
1.001
query T nosort
SELECT NULL as a
----
NULL
onlyif ClickHouse
query I nosort
SELECT CAST(NULL AS Nullable(INTEGER))
----
NULL
query T nosort
SELECT NULL
----
NULL NULL
# thish check how result hashing works
query IIIIIIIIIIIIIII nosort
SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
----
skipif ClickHouse
query I nosort
WITH RECURSIVE
cnt(x) AS (
SELECT 1
UNION ALL
SELECT x+1 FROM cnt
LIMIT 20
)
SELECT x FROM cnt;
----
20 values hashing to 52c46dff81346ead02fcf6245c762b1a
onlyif ClickHouse
query I nosort
SELECT number+1 from system.numbers LIMIT 20
----
20 values hashing to 52c46dff81346ead02fcf6245c762b1a