2020-06-07 22:19:23 +00:00
|
|
|
SET allow_experimental_live_view = 1;
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS lv;
|
2020-06-08 11:12:40 +00:00
|
|
|
DROP TABLE IF EXISTS lv2;
|
2020-06-07 22:19:23 +00:00
|
|
|
DROP TABLE IF EXISTS mt;
|
|
|
|
|
|
|
|
CREATE TABLE mt (a Int32) Engine=MergeTree order by tuple();
|
2020-06-08 11:12:40 +00:00
|
|
|
CREATE LIVE VIEW lv AS SELECT sum(a) AS sum_a FROM mt PREWHERE a > 1;
|
|
|
|
CREATE LIVE VIEW lv2 AS SELECT sum(number) AS sum_number FROM system.numbers PREWHERE number > 1;
|
2020-06-07 22:19:23 +00:00
|
|
|
|
|
|
|
INSERT INTO mt VALUES (1),(2),(3);
|
|
|
|
|
|
|
|
SELECT *,_version FROM lv;
|
2020-06-08 11:12:40 +00:00
|
|
|
SELECT *,_version FROM lv PREWHERE sum_a > 5; -- { serverError 182 }
|
2020-06-07 22:19:23 +00:00
|
|
|
|
|
|
|
INSERT INTO mt VALUES (1),(2),(3);
|
|
|
|
|
|
|
|
SELECT *,_version FROM lv;
|
2020-06-08 11:12:40 +00:00
|
|
|
SELECT *,_version FROM lv PREWHERE sum_a > 10; -- { serverError 182 }
|
|
|
|
|
|
|
|
SELECT *,_version FROM lv2; -- { serverError 182 }
|
|
|
|
SELECT *,_version FROM lv2 PREWHERE sum_number > 10; -- { serverError 182 }
|
2020-06-07 22:19:23 +00:00
|
|
|
|
|
|
|
DROP TABLE lv;
|
2020-06-08 11:12:40 +00:00
|
|
|
DROP TABLE lv2;
|
2020-06-07 22:19:23 +00:00
|
|
|
DROP TABLE mt;
|