From 98953bc27463c72af116e948b60bc326f2fcdeda Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 30 Oct 2021 15:29:38 +0300 Subject: [PATCH] Fix test --- .../01073_bad_alter_partition.reference | 22 +++++++++++++++++++ .../0_stateless/01073_bad_alter_partition.sql | 19 +++++++++------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/tests/queries/0_stateless/01073_bad_alter_partition.reference b/tests/queries/0_stateless/01073_bad_alter_partition.reference index 9008cf74944..580df2ddf08 100644 --- a/tests/queries/0_stateless/01073_bad_alter_partition.reference +++ b/tests/queries/0_stateless/01073_bad_alter_partition.reference @@ -1,3 +1,25 @@ +1 2020-01-01 1 2020-01-02 +1 2020-01-03 +1 2020-01-04 +1 2020-01-05 +1 2020-01-06 +3 2020-01-01 3 2020-01-02 +3 2020-01-03 +3 2020-01-04 +3 2020-01-05 +3 2020-01-06 +4 2020-01-01 4 2020-01-02 +4 2020-01-03 +4 2020-01-05 +4 2020-01-06 +5 2020-01-01 +5 2020-01-02 +5 2020-01-03 +5 2020-01-06 +6 2020-01-01 +6 2020-01-02 +6 2020-01-03 +6 2020-01-06 diff --git a/tests/queries/0_stateless/01073_bad_alter_partition.sql b/tests/queries/0_stateless/01073_bad_alter_partition.sql index 58fc39fd68b..2e3cd47d6a0 100644 --- a/tests/queries/0_stateless/01073_bad_alter_partition.sql +++ b/tests/queries/0_stateless/01073_bad_alter_partition.sql @@ -1,19 +1,22 @@ DROP TABLE IF EXISTS merge_tree; CREATE TABLE merge_tree (d Date) ENGINE = MergeTree ORDER BY d PARTITION BY d; -INSERT INTO merge_tree VALUES ('2020-01-02'); -SELECT 1, * FROM merge_tree; +INSERT INTO merge_tree VALUES ('2020-01-01'), ('2020-01-02'), ('2020-01-03'), ('2020-01-04'), ('2020-01-05'), ('2020-01-06'); +SELECT 1, * FROM merge_tree ORDER BY d; -- ALTER TABLE merge_tree DROP PARTITION 2020-01-02; -- This does not even parse -- SELECT 2, * FROM merge_tree; -ALTER TABLE merge_tree DROP PARTITION 20200102; -SELECT 3, * FROM merge_tree; +ALTER TABLE merge_tree DROP PARTITION 20200103; -- unfortunately, this works, but not as user expected. +SELECT 3, * FROM merge_tree ORDER BY d; -ALTER TABLE merge_tree DROP PARTITION '20200102'; -- { serverError 38 } -SELECT 4, * FROM merge_tree; +ALTER TABLE merge_tree DROP PARTITION '20200104'; +SELECT 4, * FROM merge_tree ORDER BY d; -ALTER TABLE merge_tree DROP PARTITION '2020-01-02'; -SELECT 5, * FROM merge_tree; +ALTER TABLE merge_tree DROP PARTITION '2020-01-05'; +SELECT 5, * FROM merge_tree ORDER BY d; + +ALTER TABLE merge_tree DROP PARTITION '202001-06'; -- { serverError 38 } +SELECT 6, * FROM merge_tree ORDER BY d; DROP TABLE merge_tree;