mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
dbms: added test [#METR-19265].
This commit is contained in:
parent
37d4dcb587
commit
14854540ba
@ -0,0 +1,17 @@
|
|||||||
|
┌─────[1mx[0m─┬─[1my[0m─┐
|
||||||
|
│ Hello │ 0 │
|
||||||
|
└───────┴───┘
|
||||||
|
┌─────[1mx[0m─┬─[1my[0m─┐
|
||||||
|
│ Hello │ 0 │
|
||||||
|
│ \\ │ 0 │
|
||||||
|
└───────┴───┘
|
||||||
|
┌─────[1mx[0m─┬─[1my[0m─┐
|
||||||
|
│ Hello │ 0 │
|
||||||
|
│ \\ │ 0 │
|
||||||
|
│ \t\\t │ 0 │
|
||||||
|
└───────┴───┘
|
||||||
|
┌─────[1mx[0m─┬─[1my[0m─┬─[1mtoInt8(x)[0m─┬─[1ms[0m─────┬─[1mcasted[0m─┐
|
||||||
|
│ Hello │ 0 │ -100 │ Hello │ Hello │
|
||||||
|
│ \\ │ 0 │ 0 │ \\ │ \\ │
|
||||||
|
│ \t\\t │ 0 │ 111 │ \t\\t │ \t\\t │
|
||||||
|
└───────┴───┴───────────┴───────┴────────┘
|
12
dbms/tests/queries/0_stateless/00298_enum_width_and_cast.sql
Normal file
12
dbms/tests/queries/0_stateless/00298_enum_width_and_cast.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
DROP TABLE IF EXISTS test.enum;
|
||||||
|
|
||||||
|
CREATE TABLE test.enum (x Enum8('Hello' = -100, '\\' = 0, '\t\\t' = 111), y UInt8) ENGINE = TinyLog;
|
||||||
|
INSERT INTO test.enum (y) VALUES (0);
|
||||||
|
SELECT * FROM test.enum ORDER BY x, y FORMAT PrettyCompact;
|
||||||
|
INSERT INTO test.enum (x) VALUES ('\\');
|
||||||
|
SELECT * FROM test.enum ORDER BY x, y FORMAT PrettyCompact;
|
||||||
|
INSERT INTO test.enum (x) VALUES ('\t\\t');
|
||||||
|
SELECT * FROM test.enum ORDER BY x, y FORMAT PrettyCompact;
|
||||||
|
SELECT x, y, toInt8(x), toString(x) AS s, CAST(s AS Enum8('Hello' = -100, '\\' = 0, '\t\\t' = 111)) AS casted FROM test.enum ORDER BY x, y FORMAT PrettyCompact;
|
||||||
|
|
||||||
|
DROP TABLE test.enum;
|
Loading…
Reference in New Issue
Block a user