mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Add regression test for bug fixed by recent refactoring.
Test case by Andres Freund for bug fixed by Tom Lane's refactoring
in commit 5194024d72
This commit is contained in:
parent
87d3b35a1c
commit
200ba1667b
@ -418,3 +418,15 @@ NOTICE: drop cascades to 3 other objects
|
|||||||
DETAIL: drop cascades to view v_test2
|
DETAIL: drop cascades to view v_test2
|
||||||
drop cascades to materialized view mv_test2
|
drop cascades to materialized view mv_test2
|
||||||
drop cascades to materialized view mv_test3
|
drop cascades to materialized view mv_test3
|
||||||
|
-- test a corner case for "with no data" versus a query which yields no rows
|
||||||
|
CREATE MATERIALIZED VIEW matview_unit_false AS SELECT false WHERE false WITH NO DATA;
|
||||||
|
SELECT * FROM matview_unit_false;
|
||||||
|
ERROR: materialized view "matview_unit_false" has not been populated
|
||||||
|
HINT: Use the REFRESH MATERIALIZED VIEW command.
|
||||||
|
REFRESH MATERIALIZED VIEW matview_unit_false;
|
||||||
|
SELECT * FROM matview_unit_false;
|
||||||
|
bool
|
||||||
|
------
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
DROP MATERIALIZED VIEW matview_unit_false;
|
||||||
|
@ -129,3 +129,10 @@ CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
|
|||||||
SELECT pg_relation_is_scannable('mv_test3'::regclass);
|
SELECT pg_relation_is_scannable('mv_test3'::regclass);
|
||||||
|
|
||||||
DROP VIEW v_test1 CASCADE;
|
DROP VIEW v_test1 CASCADE;
|
||||||
|
|
||||||
|
-- test a corner case for "with no data" versus a query which yields no rows
|
||||||
|
CREATE MATERIALIZED VIEW matview_unit_false AS SELECT false WHERE false WITH NO DATA;
|
||||||
|
SELECT * FROM matview_unit_false;
|
||||||
|
REFRESH MATERIALIZED VIEW matview_unit_false;
|
||||||
|
SELECT * FROM matview_unit_false;
|
||||||
|
DROP MATERIALIZED VIEW matview_unit_false;
|
||||||
|
Loading…
Reference in New Issue
Block a user