From 5fc28edb16c4f936c57d241cf3307a5b40083d3b Mon Sep 17 00:00:00 2001 From: Artem Zuikov Date: Wed, 29 Apr 2020 14:37:30 +0300 Subject: [PATCH] test fo fixed issue #7798 --- ...129_dict_get_join_lose_constness.reference | 1 + .../01129_dict_get_join_lose_constness.sql | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference create mode 100644 tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql diff --git a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference new file mode 100644 index 00000000000..f7263967932 --- /dev/null +++ b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference @@ -0,0 +1 @@ +0 0000-00-00 00:00:00 diff --git a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql new file mode 100644 index 00000000000..0f8f5cb2a06 --- /dev/null +++ b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql @@ -0,0 +1,21 @@ +DROP DICTIONARY IF EXISTS system.dict1; + +CREATE DICTIONARY IF NOT EXISTS system.dict1 +( + bytes_allocated UInt64, + element_count Int32, + loading_start_time DateTime +) +PRIMARY KEY bytes_allocated +SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' PASSWORD '' TABLE 'dictionaries' DB 'system')) +LIFETIME(0) +LAYOUT(hashed()); + +SELECT dictGetInt32('system.dict1', 'element_count', toUInt64(dict_key)) AS join_key, + dictGetDateTime('system.dict1', 'loading_start_time', toUInt64(dict_key)) AS datetime +FROM (select 1 AS dict_key) js1 +LEFT JOIN (SELECT toInt32(2) AS join_key) js2 +USING (join_key) +WHERE now() >= datetime; + +DROP DICTIONARY IF EXISTS system.dict1;