mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Make table names in some stateless tests unique.
Hoping this fixes strange failures we've been seeing under MemorySanitizer.
This commit is contained in:
parent
197033dceb
commit
be331e3e9c
@ -1,20 +1,20 @@
|
|||||||
DROP TABLE IF EXISTS src;
|
DROP TABLE IF EXISTS src_00726;
|
||||||
DROP TABLE IF EXISTS mv1;
|
DROP TABLE IF EXISTS mv1_00726;
|
||||||
DROP TABLE IF EXISTS mv2;
|
DROP TABLE IF EXISTS mv2_00726;
|
||||||
|
|
||||||
CREATE TABLE src (x UInt8) ENGINE = Null;
|
CREATE TABLE src_00726 (x UInt8) ENGINE = Null;
|
||||||
CREATE MATERIALIZED VIEW mv1 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 0;
|
CREATE MATERIALIZED VIEW mv1_00726 ENGINE = Memory AS SELECT x FROM src_00726 WHERE x % 2 = 0;
|
||||||
CREATE MATERIALIZED VIEW mv2 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 1;
|
CREATE MATERIALIZED VIEW mv2_00726 ENGINE = Memory AS SELECT x FROM src_00726 WHERE x % 2 = 1;
|
||||||
|
|
||||||
SET parallel_view_processing = 1;
|
SET parallel_view_processing = 1;
|
||||||
INSERT INTO src VALUES (1), (2);
|
INSERT INTO src_00726 VALUES (1), (2);
|
||||||
|
|
||||||
SET parallel_view_processing = 0;
|
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 mv1_00726 ORDER BY x;
|
||||||
SELECT * FROM mv2 ORDER BY x;
|
SELECT * FROM mv2_00726 ORDER BY x;
|
||||||
|
|
||||||
DROP TABLE mv1;
|
DROP TABLE mv1_00726;
|
||||||
DROP TABLE mv2;
|
DROP TABLE mv2_00726;
|
||||||
DROP TABLE src;
|
DROP TABLE src_00726;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
DROP TABLE IF EXISTS src;
|
DROP TABLE IF EXISTS src_00942;
|
||||||
DROP TABLE IF EXISTS view_table;
|
DROP TABLE IF EXISTS view_table_00942;
|
||||||
DROP TABLE IF EXISTS new_view_table;
|
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);
|
INSERT INTO src_00942 VALUES (1), (2), (3);
|
||||||
SELECT * FROM view_table ORDER BY x;
|
SELECT * FROM view_table_00942 ORDER BY x;
|
||||||
|
|
||||||
--Check if we can rename the view and if we can still fetch datas
|
--Check if we can rename the view and if we can still fetch datas
|
||||||
|
|
||||||
RENAME TABLE view_table TO new_view_table;
|
RENAME TABLE view_table_00942 TO new_view_table_00942;
|
||||||
SELECT * FROM new_view_table ORDER BY x;
|
SELECT * FROM new_view_table_00942 ORDER BY x;
|
||||||
|
|
||||||
DROP TABLE src;
|
DROP TABLE src_00942;
|
||||||
DROP TABLE IF EXISTS view_table;
|
DROP TABLE IF EXISTS view_table_00942;
|
||||||
DROP TABLE IF EXISTS new_view_table;
|
DROP TABLE IF EXISTS new_view_table_00942;
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
DROP TABLE IF EXISTS src;
|
DROP TABLE IF EXISTS src_01019;
|
||||||
DROP TABLE IF EXISTS dest;
|
DROP TABLE IF EXISTS dest_01019;
|
||||||
DROP TABLE IF EXISTS pipe;
|
DROP TABLE IF EXISTS pipe_01019;
|
||||||
|
|
||||||
CREATE TABLE src(v UInt64) ENGINE = Null;
|
CREATE TABLE src_01019(v UInt64) ENGINE = Null;
|
||||||
CREATE TABLE dest(v UInt64) Engine = MergeTree() ORDER BY v;
|
CREATE TABLE dest_01019(v UInt64) Engine = MergeTree() ORDER BY v;
|
||||||
|
|
||||||
CREATE MATERIALIZED VIEW pipe TO dest AS
|
CREATE MATERIALIZED VIEW pipe_01019 TO dest_01019 AS
|
||||||
SELECT v FROM src;
|
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;
|
SET allow_experimental_alter_materialized_view_structure = 1;
|
||||||
|
|
||||||
-- Live alter which changes query logic and adds an extra column.
|
-- Live alter which changes query logic and adds an extra column.
|
||||||
ALTER TABLE pipe
|
ALTER TABLE pipe_01019
|
||||||
MODIFY QUERY
|
MODIFY QUERY
|
||||||
SELECT
|
SELECT
|
||||||
v * 2 as v,
|
v * 2 as v,
|
||||||
1 as v2
|
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;
|
ADD COLUMN v2 UInt64;
|
||||||
|
|
||||||
INSERT INTO src VALUES (42);
|
INSERT INTO src_01019 VALUES (42);
|
||||||
SELECT * FROM dest ORDER BY v;
|
SELECT * FROM dest_01019 ORDER BY v;
|
||||||
|
|
||||||
DROP TABLE src;
|
DROP TABLE src_01019;
|
||||||
DROP TABLE dest;
|
DROP TABLE dest_01019;
|
||||||
DROP TABLE pipe;
|
DROP TABLE pipe_01019;
|
||||||
|
Loading…
Reference in New Issue
Block a user