ClickHouse/tests/queries/0_stateless/01602_show_create_view.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.6 KiB
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: no-parallel
2020-12-14 14:37:25 +00:00
DROP DATABASE IF EXISTS test_1602;
CREATE DATABASE test_1602;
CREATE TABLE test_1602.tbl (`EventDate` DateTime, `CounterID` UInt32, `UserID` UInt32) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SETTINGS index_granularity = 8192;
2020-12-15 12:29:26 +00:00
CREATE VIEW test_1602.v AS SELECT * FROM test_1602.tbl;
CREATE VIEW test_1602.DATABASE AS SELECT * FROM test_1602.tbl;
CREATE VIEW test_1602.DICTIONARY AS SELECT * FROM test_1602.tbl;
CREATE VIEW test_1602.TABLE AS SELECT * FROM test_1602.tbl;
2020-12-14 14:37:25 +00:00
CREATE MATERIALIZED VIEW test_1602.vv (`EventDate` DateTime, `CounterID` UInt32, `UserID` UInt32) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SETTINGS index_granularity = 8192 AS SELECT * FROM test_1602.tbl;
CREATE VIEW test_1602.VIEW AS SELECT * FROM test_1602.tbl;
2020-12-14 14:37:25 +00:00
SET allow_experimental_live_view=1;
CREATE LIVE VIEW test_1602.vvv AS SELECT * FROM test_1602.tbl;
SHOW CREATE VIEW test_1602.v;
SHOW CREATE VIEW test_1602.vv;
SHOW CREATE VIEW test_1602.vvv;
SHOW CREATE VIEW test_1602.not_exist_view; -- { serverError 390 }
2020-12-15 12:29:26 +00:00
SHOW CREATE VIEW test_1602.tbl; -- { serverError 36 }
2020-12-14 14:37:25 +00:00
SHOW CREATE TEMPORARY VIEW; -- { serverError 60 }
SHOW CREATE VIEW; -- { clientError 62 }
SHOW CREATE DATABASE; -- { clientError 62 }
SHOW CREATE DICTIONARY; -- { clientError 62 }
SHOW CREATE TABLE; -- { clientError 62 }
SHOW CREATE test_1602.VIEW;
SHOW CREATE test_1602.DATABASE;
SHOW CREATE test_1602.DICTIONARY;
SHOW CREATE test_1602.TABLE;
2020-12-14 14:37:25 +00:00
DROP DATABASE IF EXISTS test_1602;