ClickHouse/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.sql
Alexander Kuzmenkov be331e3e9c Make table names in some stateless tests unique.
Hoping this fixes strange failures we've been seeing under MemorySanitizer.
2020-03-30 15:59:01 +03:00

21 lines
623 B
SQL

DROP TABLE IF EXISTS src_00726;
DROP TABLE IF EXISTS mv1_00726;
DROP TABLE IF EXISTS mv2_00726;
CREATE TABLE src_00726 (x UInt8) ENGINE = Null;
CREATE MATERIALIZED VIEW mv1_00726 ENGINE = Memory AS SELECT x FROM src_00726 WHERE x % 2 = 0;
CREATE MATERIALIZED VIEW mv2_00726 ENGINE = Memory AS SELECT x FROM src_00726 WHERE x % 2 = 1;
SET parallel_view_processing = 1;
INSERT INTO src_00726 VALUES (1), (2);
SET parallel_view_processing = 0;
INSERT INTO src_00726 VALUES (3), (4);
SELECT * FROM mv1_00726 ORDER BY x;
SELECT * FROM mv2_00726 ORDER BY x;
DROP TABLE mv1_00726;
DROP TABLE mv2_00726;
DROP TABLE src_00726;