2020-03-30 12:58:00 +00:00
|
|
|
DROP TABLE IF EXISTS src_00942;
|
|
|
|
DROP TABLE IF EXISTS view_table_00942;
|
|
|
|
DROP TABLE IF EXISTS new_view_table_00942;
|
2019-05-07 06:54:55 +00:00
|
|
|
|
2020-03-30 12:58:00 +00:00
|
|
|
CREATE TABLE src_00942 (x UInt8) ENGINE = Null;
|
2019-05-07 06:54:55 +00:00
|
|
|
|
2020-03-30 12:58:00 +00:00
|
|
|
CREATE MATERIALIZED VIEW view_table_00942 Engine = Memory AS SELECT * FROM src_00942;
|
2019-05-07 06:54:55 +00:00
|
|
|
|
2020-03-30 12:58:00 +00:00
|
|
|
INSERT INTO src_00942 VALUES (1), (2), (3);
|
|
|
|
SELECT * FROM view_table_00942 ORDER BY x;
|
2019-05-07 06:54:55 +00:00
|
|
|
|
|
|
|
--Check if we can rename the view and if we can still fetch datas
|
|
|
|
|
2020-03-30 12:58:00 +00:00
|
|
|
RENAME TABLE view_table_00942 TO new_view_table_00942;
|
|
|
|
SELECT * FROM new_view_table_00942 ORDER BY x;
|
2019-05-07 06:54:55 +00:00
|
|
|
|
2020-03-30 12:58:00 +00:00
|
|
|
DROP TABLE src_00942;
|
|
|
|
DROP TABLE IF EXISTS view_table_00942;
|
|
|
|
DROP TABLE IF EXISTS new_view_table_00942;
|