github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/view/alterview.result (about) 1 drop database if exists db; 2 create database db; 3 use db; 4 CREATE TABLE t(f1 INTEGER); 5 insert into t values(1),(2),(3),(6); 6 CREATE VIEW v AS SELECT f1 FROM t; 7 select f1 from v; 8 f1 9 1 10 2 11 3 12 6 13 ALTER VIEW v AS SELECT f1 FROM (SELECT f1 FROM v) AS dt1 NATURAL JOIN v dt2 WHERE f1 > 5; 14 internal error: there is a recursive reference to the view v 15 create view v2 as select f1 from v; 16 select f1 from v2; 17 f1 18 1 19 2 20 3 21 6 22 ALTER VIEW v AS SELECT f1 FROM (SELECT f1 FROM v2) AS dt1 NATURAL JOIN v2 dt2 WHERE f1 > 5; 23 internal error: there is a recursive reference to the view v 24 drop database if exists db2; 25 create database db2; 26 use db2; 27 create view v3 as select f1 from db.v; 28 select f1 from v3; 29 f1 30 1 31 2 32 3 33 6 34 use db; 35 ALTER VIEW v AS SELECT f1 FROM (SELECT f1 FROM db2.v3) AS dt1 NATURAL JOIN db2.v3 dt2 WHERE f1 > 5; 36 internal error: there is a recursive reference to the view v 37 select * from vx; 38 SQL parser error: table "vx" does not exist 39 alter view v as select f1 from t; 40 select * from v; 41 f1 42 1 43 2 44 3 45 6 46 drop database if exists db; 47 drop database if exists db2;