git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e182701)
Improve regression test for pg_filenode_relation().
2014年3月28日 20:58:09 +0000 (16:58 -0400)
2014年3月28日 20:58:29 +0000 (16:58 -0400)
Make it print the details in case there's a failure.

Andres Freund, slightly modified by me


diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 0f0c638fa5deb96dc71dd0b97f41328573ffcbb8..e2279e63c11388f89971ded996c3a28efbf78397 100644 (file)
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -2319,22 +2319,16 @@ Check constraints:
DROP TABLE alter2.tt8;
DROP SCHEMA alter2;
-- Check that we map relation oids to filenodes and back correctly.
--- Don't display all the mappings so the test output doesn't change
--- all the time, but make sure we actually do test some values.
+-- Only display bad mappings so the test output doesn't change all the
+-- time.
SELECT
- SUM((mapped_oid != oid OR mapped_oid IS NULL)::int) incorrectly_mapped,
- count(*) > 200 have_mappings
-FROM (
- SELECT
- oid, reltablespace, relfilenode, relname,
- pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) mapped_oid
- FROM pg_class
- WHERE relkind IN ('r', 'i', 'S', 't', 'm')
- ) mapped;
- incorrectly_mapped | have_mappings
---------------------+---------------
- 0 | t
-(1 row)
+ oid, mapped_oid, reltablespace, relfilenode, relname
+FROM pg_class,
+ pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) AS mapped_oid
+WHERE relkind IN ('r', 'i', 'S', 't', 'm') AND mapped_oid IS DISTINCT FROM oid;
+ oid | mapped_oid | reltablespace | relfilenode | relname
+-----+------------+---------------+-------------+---------
+(0 rows)
-- Checks on creating and manipulation of user defined relations in
-- pg_catalog.
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index 87973c19550d67450fbe8a2305c20c982361ed17..2f2c2e350263ae45d18ad8bc1750aa8a0b2d4afe 100644 (file)
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -1554,18 +1554,13 @@ DROP TABLE alter2.tt8;
DROP SCHEMA alter2;
-- Check that we map relation oids to filenodes and back correctly.
--- Don't display all the mappings so the test output doesn't change
--- all the time, but make sure we actually do test some values.
+-- Only display bad mappings so the test output doesn't change all the
+-- time.
SELECT
- SUM((mapped_oid != oid OR mapped_oid IS NULL)::int) incorrectly_mapped,
- count(*) > 200 have_mappings
-FROM (
- SELECT
- oid, reltablespace, relfilenode, relname,
- pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) mapped_oid
- FROM pg_class
- WHERE relkind IN ('r', 'i', 'S', 't', 'm')
- ) mapped;
+ oid, mapped_oid, reltablespace, relfilenode, relname
+FROM pg_class,
+ pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) AS mapped_oid
+WHERE relkind IN ('r', 'i', 'S', 't', 'm') AND mapped_oid IS DISTINCT FROM oid;
-- Checks on creating and manipulation of user defined relations in
-- pg_catalog.
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /