Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit200ba16

Browse files
committed
Add regression test for bug fixed by recent refactoring.
Test case by Andres Freund for bug fixed by Tom Lane's refactoringin commit5194024
1 parent87d3b35 commit200ba16

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎src/test/regress/expected/matview.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,15 @@ NOTICE: drop cascades to 3 other objects
418418
DETAIL: drop cascades to view v_test2
419419
drop cascades to materialized view mv_test2
420420
drop cascades to materialized view mv_test3
421+
-- test a corner case for "with no data" versus a query which yields no rows
422+
CREATE MATERIALIZED VIEW matview_unit_false AS SELECT false WHERE false WITH NO DATA;
423+
SELECT * FROM matview_unit_false;
424+
ERROR: materialized view "matview_unit_false" has not been populated
425+
HINT: Use the REFRESH MATERIALIZED VIEW command.
426+
REFRESH MATERIALIZED VIEW matview_unit_false;
427+
SELECT * FROM matview_unit_false;
428+
bool
429+
------
430+
(0 rows)
431+
432+
DROP MATERIALIZED VIEW matview_unit_false;

‎src/test/regress/sql/matview.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,10 @@ CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
129129
SELECT pg_relation_is_scannable('mv_test3'::regclass);
130130

131131
DROPVIEW v_test1 CASCADE;
132+
133+
-- test a corner case for "with no data" versus a query which yields no rows
134+
CREATE MATERIALIZED VIEW matview_unit_falseASSELECT falseWHERE false WITH NO DATA;
135+
SELECT*FROM matview_unit_false;
136+
REFRESH MATERIALIZED VIEW matview_unit_false;
137+
SELECT*FROM matview_unit_false;
138+
DROP MATERIALIZED VIEW matview_unit_false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp