diff --git a/tests/queries/0_stateless/01527_materialized_view_stack_overflow.reference b/tests/queries/0_stateless/01527_materialized_view_stack_overflow.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/01527_materialized_view_stack_overflow.sql b/tests/queries/0_stateless/01527_materialized_view_stack_overflow.sql new file mode 100644 index 00000000000..4a67ef4b2d8 --- /dev/null +++ b/tests/queries/0_stateless/01527_materialized_view_stack_overflow.sql @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS t; +DROP TABLE IF EXISTS v; + +CREATE TABLE t (c String) ENGINE = Memory; + +CREATE MATERIALIZED VIEW v to v AS SELECT c FROM t; -- { serverError 36 } +CREATE MATERIALIZED VIEW v to t AS SELECT * FROM v; -- { serverError 60 } + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS v1; +DROP TABLE IF EXISTS v2; + +CREATE TABLE t1 (c String) ENGINE = Memory; +CREATE TABLE t2 (c String) ENGINE = Memory; + +CREATE MATERIALIZED VIEW v1 to t1 AS SELECT * FROM t2; +CREATE MATERIALIZED VIEW v2 to t2 AS SELECT * FROM t1; + +INSERT INTO t1 VALUES ('Hello'); -- { serverError 306 } +INSERT INTO t2 VALUES ('World'); -- { serverError 306 } + +DROP TABLE IF EXISTS t; +DROP TABLE IF EXISTS v; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS v1; +DROP TABLE IF EXISTS v2;