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.

48 lines
1.5 KiB
MySQL
Raw Normal View History

2023-05-06 20:34:05 +00:00
-- Tags: no-parallel
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;
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;
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;
SHOW CREATE VIEW test_1602.v;
SHOW CREATE VIEW test_1602.vv;
SHOW CREATE VIEW test_1602.not_exist_view; -- { serverError CANNOT_GET_CREATE_TABLE_QUERY }
2023-05-06 20:34:05 +00:00
SHOW CREATE VIEW test_1602.tbl; -- { serverError BAD_ARGUMENTS }
2023-05-06 20:34:05 +00:00
SHOW CREATE TEMPORARY VIEW; -- { serverError UNKNOWN_TABLE }
2023-05-06 20:34:05 +00:00
SHOW CREATE VIEW; -- { clientError SYNTAX_ERROR }
2023-05-06 20:34:05 +00:00
SHOW CREATE DATABASE; -- { clientError SYNTAX_ERROR }
2023-05-06 20:34:05 +00:00
SHOW CREATE DICTIONARY; -- { clientError SYNTAX_ERROR }
2023-05-06 20:34:05 +00:00
SHOW CREATE TABLE; -- { clientError SYNTAX_ERROR }
2023-05-06 20:34:05 +00:00
SHOW CREATE test_1602.VIEW;
SHOW CREATE test_1602.DATABASE;
SHOW CREATE test_1602.DICTIONARY;
SHOW CREATE test_1602.TABLE;
DROP DATABASE IF EXISTS test_1602;