This commit is contained in:
Vitaliy Zakaznikov 2019-12-06 13:57:28 +01:00
parent 590a1f7b87
commit 16d6674c00
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,8 @@
1 hello 2
1 hello 2
1 hello 3
2 hello 3
2 hello2 3
1 hello 3
2 hello 3
2 hello2 3

View File

@ -0,0 +1,30 @@
SET allow_experimental_live_view = 1;
DROP TABLE IF EXISTS test.lv;
DROP TABLE IF EXISTS test.A;
DROP TABLE IF EXISTS test.B;
CREATE TABLE test.A (id Int32) Engine=Memory;
CREATE TABLE test.B (id Int32, name String) Engine=Memory;
CREATE LIVE VIEW test.lv AS SELECT id, name FROM ( SELECT A.id, B.name FROM test.A as A, test.B as B WHERE A.id = B.id );
SELECT * FROM test.lv;
INSERT INTO test.A VALUES (1);
INSERT INTO test.B VALUES (1, 'hello');
SELECT *,_version FROM test.lv;
SELECT *,_version FROM test.lv;
INSERT INTO test.A VALUES (2)
INSERT INTO test.B VALUES (2, 'hello')
INSERT INTO test.B VALUES (2, 'hello2')
SELECT *,_version FROM test.lv;
SELECT *,_version FROM test.lv;
DROP TABLE test.lv;
DROP TABLE test.A;
DROP TABLE test.B;