From c0eefb644e317a8b7cb9985f60ad440777ab33f1 Mon Sep 17 00:00:00 2001 From: Denis Zhuravlev Date: Thu, 4 Mar 2021 16:58:12 -0400 Subject: [PATCH] test for #21413 --- ...746_test_for_tupleElement_must_be_constant_issue.reference | 1 + .../01746_test_for_tupleElement_must_be_constant_issue.sql | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.reference b/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.reference index e00053fb282..6592226b0ac 100644 --- a/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.reference +++ b/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.reference @@ -1 +1,2 @@ [('a',10)] +[('a',10)] diff --git a/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.sql b/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.sql index f86d11998b0..72ba6a036df 100644 --- a/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.sql +++ b/tests/queries/0_stateless/01746_test_for_tupleElement_must_be_constant_issue.sql @@ -1,5 +1,7 @@ DROP TABLE IF EXISTS ttt01746; CREATE TABLE ttt01746 (d Date, n UInt64) ENGINE = MergeTree() PARTITION BY toMonday(d) ORDER BY n; -INSERT INTO ttt01746 SELECT toDate('2021-02-14') + (number % 30) AS d, number AS n FROM numbers(100000); +INSERT INTO ttt01746 SELECT toDate('2021-02-14') + (number % 30) AS d, number AS n FROM numbers(1500000); +set optimize_move_to_prewhere=0; SELECT arraySort(x -> x.2, [tuple('a', 10)]) AS X FROM ttt01746 WHERE d >= toDate('2021-03-03') - 2 ORDER BY n LIMIT 1; +SELECT arraySort(x -> x.2, [tuple('a', 10)]) AS X FROM ttt01746 PREWHERE d >= toDate('2021-03-03') - 2 ORDER BY n LIMIT 1; DROP TABLE ttt01746;