mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added test [#CLICKHOUSE-3764]
This commit is contained in:
parent
7125db4679
commit
f71eb36719
12
dbms/tests/queries/0_stateless/00642_cast.reference
Normal file
12
dbms/tests/queries/0_stateless/00642_cast.reference
Normal file
@ -0,0 +1,12 @@
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
CREATE TABLE test.cast ( x UInt8, e Enum8('hello' = 1, 'world' = 2) DEFAULT CAST(x, 'Enum8(\'hello\' = 1, \'world\' = 2)')) ENGINE = MergeTree ORDER BY e SETTINGS index_granularity = 8192
|
||||
x UInt8
|
||||
e Enum8(\'hello\' = 1, \'world\' = 2) DEFAULT CAST(x, \'Enum8(\\\'hello\\\' = 1, \\\'world\\\' = 2)\')
|
||||
1 hello
|
46
dbms/tests/queries/0_stateless/00642_cast.sql
Normal file
46
dbms/tests/queries/0_stateless/00642_cast.sql
Normal file
@ -0,0 +1,46 @@
|
||||
SELECT CAST(1 AS Enum8('hello' = 1, 'world' = 2));
|
||||
SELECT cast(1 AS Enum8('hello' = 1, 'world' = 2));
|
||||
|
||||
SELECT CAST(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
||||
SELECT cast(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
||||
|
||||
SELECT CAST(1 AS Enum8(
|
||||
'hello' = 1,
|
||||
'world' = 2));
|
||||
|
||||
SELECT cast(1 AS Enum8(
|
||||
'hello' = 1,
|
||||
'world' = 2));
|
||||
|
||||
SELECT CAST(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
|
||||
SELECT cast(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
|
||||
|
||||
DROP TABLE IF EXISTS test.cast;
|
||||
CREATE TABLE test.cast
|
||||
(
|
||||
x UInt8,
|
||||
e Enum8
|
||||
(
|
||||
'hello' = 1,
|
||||
'world' = 2
|
||||
)
|
||||
DEFAULT
|
||||
CAST
|
||||
(
|
||||
x
|
||||
AS
|
||||
Enum8
|
||||
(
|
||||
'hello' = 1,
|
||||
'world' = 2
|
||||
)
|
||||
)
|
||||
) ENGINE = MergeTree ORDER BY e;
|
||||
|
||||
SHOW CREATE TABLE test.cast FORMAT TSVRaw;
|
||||
DESC TABLE test.cast;
|
||||
|
||||
INSERT INTO test.cast (x) VALUES (1);
|
||||
SELECT * FROM test.cast;
|
||||
|
||||
DROP TABLE test.cast;
|
Loading…
Reference in New Issue
Block a user