From e0ab461636ea85046f93c6ce1be8113c9e3e0a1e Mon Sep 17 00:00:00 2001 From: Denis Zhuravlev Date: Sat, 27 Mar 2021 19:43:26 -0300 Subject: [PATCH] test for #10489 --- ...st_LowCardinality_FixedString_pk.reference | 3 +++ ...778_test_LowCardinality_FixedString_pk.sql | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.reference create mode 100644 tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.sql diff --git a/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.reference b/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.reference new file mode 100644 index 00000000000..a134ce52c11 --- /dev/null +++ b/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.reference @@ -0,0 +1,3 @@ +100 +100 +100 diff --git a/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.sql b/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.sql new file mode 100644 index 00000000000..1a0a1d35f76 --- /dev/null +++ b/tests/queries/0_stateless/01778_test_LowCardinality_FixedString_pk.sql @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS test_01778; + +CREATE TABLE test_01778 +( + `key` LowCardinality(FixedString(3)), + `d` date +) +ENGINE = MergeTree(d, key, 8192); + + +INSERT INTO test_01778 SELECT toString(intDiv(number,8000)), today() FROM numbers(100000); +INSERT INTO test_01778 SELECT toString('xxx'), today() FROM numbers(100); + +SELECT count() FROM test_01778 WHERE key = 'xxx'; + +SELECT count() FROM test_01778 WHERE key = toFixedString('xxx', 3); + +SELECT count() FROM test_01778 WHERE toString(key) = 'xxx'; + +DROP TABLE test_01778; +