Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d7ff13

Browse files
committed
Add regression test for MV join to view.
This would have caught a bug in the initial patch, and seems like a good thing to test going forward. Per bug report by Erik Rijkers and fix by Tom Lane
1 parent f7559c0 commit 8d7ff13

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/test/regress/expected/matview.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,15 @@ SELECT * FROM tum;
327327
x | 5
328328
(3 rows)
329329

330+
-- test join of mv and view
331+
SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type);
332+
type | mtot | vtot
333+
------+------+------
334+
y | 12 | 12
335+
z | 24 | 24
336+
x | 5 | 5
337+
(3 rows)
338+
330339
-- test diemv when the mv does exist
331340
DROP MATERIALIZED VIEW IF EXISTS tum;
332341
-- make sure that dependencies are reported properly when they block the drop

src/test/regress/sql/matview.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ REFRESH MATERIALIZED VIEW tum WITH DATA;
103103
SELECT pg_relation_is_scannable('tum'::regclass);
104104
SELECT * FROM tum;
105105

106+
-- test join of mv and view
107+
SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type);
108+
106109
-- test diemv when the mv does exist
107110
DROP MATERIALIZED VIEW IF EXISTS tum;
108111

0 commit comments

Comments
 (0)