00843_optimize_predicate_and_rename_table.sql 505 字节
Newer Older
A
Alexey Milovidov 已提交
1 2
SET enable_optimize_predicate_expression = 1;

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
DROP TABLE IF EXISTS test.test1;
DROP TABLE IF EXISTS test.test2;
DROP TABLE IF EXISTS test.view;

CREATE TABLE test.test1 (a UInt8) ENGINE = Memory;
INSERT INTO test.test1 VALUES (1);

CREATE VIEW test.view AS SELECT * FROM test.test1;
SELECT * FROM test.view;
RENAME TABLE test.test1 TO test.test2;
SELECT * FROM test.view; -- { serverError 60 }
RENAME TABLE test.test2 TO test.test1;
SELECT * FROM test.view;

DROP TABLE test.test1;
DROP TABLE test.view;