Make table names in some stateless tests unique.

Hoping this fixes strange failures we've been seeing under MemorySanitizer.
This commit is contained in:
Alexander Kuzmenkov 2020-03-30 15:58:00 +03:00
parent 197033dceb
commit be331e3e9c
3 changed files with 43 additions and 43 deletions

View File

@ -1,20 +1,20 @@
DROP TABLE IF EXISTS src;
DROP TABLE IF EXISTS mv1;
DROP TABLE IF EXISTS mv2;
DROP TABLE IF EXISTS src_00726;
DROP TABLE IF EXISTS mv1_00726;
DROP TABLE IF EXISTS mv2_00726;
CREATE TABLE src (x UInt8) ENGINE = Null;
CREATE MATERIALIZED VIEW mv1 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 0;
CREATE MATERIALIZED VIEW mv2 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 1;
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 VALUES (1), (2);
INSERT INTO src_00726 VALUES (1), (2);
SET parallel_view_processing = 0;
INSERT INTO src VALUES (3), (4);
INSERT INTO src_00726 VALUES (3), (4);
SELECT * FROM mv1 ORDER BY x;
SELECT * FROM mv2 ORDER BY x;
SELECT * FROM mv1_00726 ORDER BY x;
SELECT * FROM mv2_00726 ORDER BY x;
DROP TABLE mv1;
DROP TABLE mv2;
DROP TABLE src;
DROP TABLE mv1_00726;
DROP TABLE mv2_00726;
DROP TABLE src_00726;

View File

@ -1,19 +1,19 @@
DROP TABLE IF EXISTS src;
DROP TABLE IF EXISTS view_table;
DROP TABLE IF EXISTS new_view_table;
DROP TABLE IF EXISTS src_00942;
DROP TABLE IF EXISTS view_table_00942;
DROP TABLE IF EXISTS new_view_table_00942;
CREATE TABLE src (x UInt8) ENGINE = Null;
CREATE TABLE src_00942 (x UInt8) ENGINE = Null;
CREATE MATERIALIZED VIEW view_table Engine = Memory AS SELECT * FROM src;
CREATE MATERIALIZED VIEW view_table_00942 Engine = Memory AS SELECT * FROM src_00942;
INSERT INTO src VALUES (1), (2), (3);
SELECT * FROM view_table ORDER BY x;
INSERT INTO src_00942 VALUES (1), (2), (3);
SELECT * FROM view_table_00942 ORDER BY x;
--Check if we can rename the view and if we can still fetch datas
RENAME TABLE view_table TO new_view_table;
SELECT * FROM new_view_table ORDER BY x;
RENAME TABLE view_table_00942 TO new_view_table_00942;
SELECT * FROM new_view_table_00942 ORDER BY x;
DROP TABLE src;
DROP TABLE IF EXISTS view_table;
DROP TABLE IF EXISTS new_view_table;
DROP TABLE src_00942;
DROP TABLE IF EXISTS view_table_00942;
DROP TABLE IF EXISTS new_view_table_00942;

View File

@ -1,35 +1,35 @@
DROP TABLE IF EXISTS src;
DROP TABLE IF EXISTS dest;
DROP TABLE IF EXISTS pipe;
DROP TABLE IF EXISTS src_01019;
DROP TABLE IF EXISTS dest_01019;
DROP TABLE IF EXISTS pipe_01019;
CREATE TABLE src(v UInt64) ENGINE = Null;
CREATE TABLE dest(v UInt64) Engine = MergeTree() ORDER BY v;
CREATE TABLE src_01019(v UInt64) ENGINE = Null;
CREATE TABLE dest_01019(v UInt64) Engine = MergeTree() ORDER BY v;
CREATE MATERIALIZED VIEW pipe TO dest AS
SELECT v FROM src;
CREATE MATERIALIZED VIEW pipe_01019 TO dest_01019 AS
SELECT v FROM src_01019;
INSERT INTO src VALUES (1), (2), (3);
INSERT INTO src_01019 VALUES (1), (2), (3);
SET allow_experimental_alter_materialized_view_structure = 1;
-- Live alter which changes query logic and adds an extra column.
ALTER TABLE pipe
ALTER TABLE pipe_01019
MODIFY QUERY
SELECT
v * 2 as v,
1 as v2
FROM src;
FROM src_01019;
INSERT INTO src VALUES (1), (2), (3);
INSERT INTO src_01019 VALUES (1), (2), (3);
SELECT * FROM dest ORDER BY v;
SELECT * FROM dest_01019 ORDER BY v;
ALTER TABLE dest
ALTER TABLE dest_01019
ADD COLUMN v2 UInt64;
INSERT INTO src VALUES (42);
SELECT * FROM dest ORDER BY v;
INSERT INTO src_01019 VALUES (42);
SELECT * FROM dest_01019 ORDER BY v;
DROP TABLE src;
DROP TABLE dest;
DROP TABLE pipe;
DROP TABLE src_01019;
DROP TABLE dest_01019;
DROP TABLE pipe_01019;