From d40fb6b5d332393f57f6480de1a287a688a66a34 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 27 Apr 2020 00:09:30 +0300 Subject: [PATCH] Added a test from @nvartolomei #6229 --- ...1263_type_conversion_nvartolomei.reference | 7 +++ .../01263_type_conversion_nvartolomei.sql | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/queries/0_stateless/01263_type_conversion_nvartolomei.reference create mode 100644 tests/queries/0_stateless/01263_type_conversion_nvartolomei.sql diff --git a/tests/queries/0_stateless/01263_type_conversion_nvartolomei.reference b/tests/queries/0_stateless/01263_type_conversion_nvartolomei.reference new file mode 100644 index 00000000000..09b593dad3d --- /dev/null +++ b/tests/queries/0_stateless/01263_type_conversion_nvartolomei.reference @@ -0,0 +1,7 @@ +123 +123 +a +a +--- +a +a diff --git a/tests/queries/0_stateless/01263_type_conversion_nvartolomei.sql b/tests/queries/0_stateless/01263_type_conversion_nvartolomei.sql new file mode 100644 index 00000000000..e3d66e9cdba --- /dev/null +++ b/tests/queries/0_stateless/01263_type_conversion_nvartolomei.sql @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS m; +DROP TABLE IF EXISTS d; + +CREATE TABLE m +( + `v` UInt8 +) +ENGINE = MergeTree() +PARTITION BY tuple() +ORDER BY v; + +CREATE TABLE d +( + `v` UInt16 +) +ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), m, rand()); + +INSERT INTO m VALUES (123); +SELECT * FROM d; + + +DROP TABLE m; +DROP TABLE d; + + +CREATE TABLE m +( + `v` Enum8('a' = 1, 'b' = 2) +) +ENGINE = MergeTree() +PARTITION BY tuple() +ORDER BY v; + +CREATE TABLE d +( + `v` Enum8('a' = 1) +) +ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), m, rand()); + +INSERT INTO m VALUES ('a'); +SELECT * FROM d; + +SELECT '---'; + +INSERT INTO m VALUES ('b'); +SELECT v FROM d ORDER BY v; -- { clientError 36 } + + +DROP TABLE m; +DROP TABLE d;