From e8f6497f7493b1185afcf29316cf4b8b316b4974 Mon Sep 17 00:00:00 2001 From: dimarub2000 Date: Fri, 5 Jul 2019 15:44:15 +0300 Subject: [PATCH] tests --- .../0_stateless/00962_enumNotExect.reference | 14 ++++++++++++++ .../queries/0_stateless/00962_enumNotExect.sql | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00962_enumNotExect.reference create mode 100644 dbms/tests/queries/0_stateless/00962_enumNotExect.sql diff --git a/dbms/tests/queries/0_stateless/00962_enumNotExect.reference b/dbms/tests/queries/0_stateless/00962_enumNotExect.reference new file mode 100644 index 00000000000..06e02da1be8 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00962_enumNotExect.reference @@ -0,0 +1,14 @@ +hello +world +hello +1 +2 +1 +hello +world +hello +1 +128 +1 +Enum16(\'a\' = 2, \'b\' = 128) +Enum8(\'a\' = 2, \'b\' = 127) diff --git a/dbms/tests/queries/0_stateless/00962_enumNotExect.sql b/dbms/tests/queries/0_stateless/00962_enumNotExect.sql new file mode 100644 index 00000000000..364c6c8d588 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00962_enumNotExect.sql @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS t_enum8; +CREATE TABLE t_enum8( x Enum('hello' = 1, 'world' = 2) ) ENGINE = TinyLog; +INSERT INTO t_enum8 Values('hello'),('world'),('hello'); +SELECT * FROM t_enum8; +SELECT CAST(x, 'Int8') FROM t_enum8; +DROP TABLE IF EXISTS t_enum16; +CREATE TABLE t_enum16( x Enum('hello' = 1, 'world' = 128) ) ENGINE = TinyLog; +INSERT INTO t_enum16 Values('hello'),('world'),('hello'); +SELECT * FROM t_enum16; +SELECT CAST(x, 'Int16') FROM t_enum16; +SELECT toTypeName(CAST('a', 'Enum(\'a\' = 2, \'b\' = 128)')); +SELECT toTypeName(CAST('a', 'Enum(\'a\' = 2, \'b\' = 127)')); +