dbms: added test [#METR-19265].

This commit is contained in:
Alexey Milovidov 2016-02-01 21:40:27 +03:00
parent 37d4dcb587
commit 14854540ba
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,17 @@
┌─────x─┬─y─┐
│ Hello │ 0 │
└───────┴───┘
┌─────x─┬─y─┐
│ Hello │ 0 │
│ \\ │ 0 │
└───────┴───┘
┌─────x─┬─y─┐
│ Hello │ 0 │
│ \\ │ 0 │
│ \t\\t │ 0 │
└───────┴───┘
┌─────x─┬─y─┬─toInt8(x)─┬─s─────┬─casted─┐
│ Hello │ 0 │ -100 │ Hello │ Hello │
│ \\ │ 0 │ 0 │ \\ │ \\ │
│ \t\\t │ 0 │ 111 │ \t\\t │ \t\\t │
└───────┴───┴───────────┴───────┴────────┘

View 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;