From 05d23dc932ab1da05030cd0d82de5e593073b084 Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Sun, 17 Nov 2024 09:23:09 -0800 Subject: [PATCH] Add DROP statements to test --- .../03263_forbid_materialize_sort_key.sql | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/queries/0_stateless/03263_forbid_materialize_sort_key.sql b/tests/queries/0_stateless/03263_forbid_materialize_sort_key.sql index 3bd46ae1ca0..a27be98e0aa 100644 --- a/tests/queries/0_stateless/03263_forbid_materialize_sort_key.sql +++ b/tests/queries/0_stateless/03263_forbid_materialize_sort_key.sql @@ -5,16 +5,20 @@ INSERT INTO test (a) SELECT 1 FROM numbers(1000); ALTER TABLE test ADD COLUMN b Float64 AFTER a, MODIFY ORDER BY (a, b); ALTER TABLE test MODIFY COLUMN b DEFAULT rand64() % 100000; ALTER TABLE test MATERIALIZE COLUMN b; -- { serverError CANNOT_UPDATE_COLUMN } +DROP TABLE IF EXISTS test; CREATE TABLE IF NOT EXISTS tab (x UInt32, y UInt32) engine = MergeTree ORDER BY tuple(); CREATE DICTIONARY IF NOT EXISTS dict (x UInt32, y UInt32) primary key x source(clickhouse(table 'tab')) LAYOUT(FLAT()) LIFETIME(MIN 0 MAX 1000); -INSERT INTO tab values (1, 2), (3, 4); +INSERT INTO tab VALUES (1, 2), (3, 4); SYSTEM RELOAD DICTIONARY dict; -CREATE TABLE IF NOT EXISTS tab2 (x UInt32, y UInt32 materialized dictGet(dict, 'y', x)) engine = MergeTree order by (y); -INSERT INTO tab2 (x) values (1), (3); +CREATE TABLE IF NOT EXISTS tab2 (x UInt32, y UInt32 materialized dictGet(dict, 'y', x)) engine = MergeTree ORDER BY (y); +INSERT INTO tab2 (x) VALUES (1), (3); TRUNCATE TABLE tab; -INSERT INTO tab values (1, 4), (3, 2); +INSERT INTO tab VALUES (1, 4), (3, 2); SYSTEM RELOAD DICTIONARY dict; SET mutations_sync=2; ALTER TABLE tab2 materialize column y; -- { serverError CANNOT_UPDATE_COLUMN } +DROP TABLE IF EXISTS tab2; +DROP DICTIONARY IF EXISTS dict; +DROP TABLE IF EXISTS tab;