fix system views test

This commit is contained in:
zhongyuankai 2021-08-27 13:21:40 +08:00
parent 3c19cd729f
commit af3a1c30f7
2 changed files with 11 additions and 9 deletions

View File

@ -1 +1 @@
default views_test_view default views_test Materialized
views_test_db views_test_view views_test_db views_test Materialized

View File

@ -1,8 +1,10 @@
DROP TABLE IF EXISTS default.views_test;
CREATE TABLE default.views_test (a UInt8, s String) ENGINE = MergeTree() ORDER BY a;
DROP TABLE IF EXISTS default.views_test_view;
CREATE MATERIALIZED VIEW default.views_test_view ENGINE = ReplacingMergeTree() ORDER BY a AS SELECT * FROM default.views_test;
SELECT * FROM system.views WHERE database = 'default' and name = 'views_test_view';
DROP TABLE IF EXISTS default.views_test_view;
SELECT * FROM system.views WHERE database = 'default' and name = 'views_test_view';
DROP TABLE IF EXISTS default.views_test;
CREATE DATABASE IF NOT EXISTS views_test_db;
DROP TABLE IF EXISTS views_test_db.views_test;
CREATE TABLE views_test_db.views_test (a UInt8, s String) ENGINE = MergeTree() ORDER BY a;
DROP TABLE IF EXISTS views_test_db.views_test_view;
CREATE MATERIALIZED VIEW views_test_db.views_test_view ENGINE = ReplacingMergeTree() ORDER BY a AS SELECT * FROM views_test_db.views_test;
SELECT * FROM system.views WHERE database = 'views_test_db' and name = 'views_test_view';
DROP TABLE IF EXISTS views_test_db.views_test_view;
SELECT * FROM system.views WHERE database = 'views_test_db' and name = 'views_test_view';
DROP TABLE IF EXISTS views_test_db.views_test;
DROP DATABASE IF EXISTS views_test_db;