From bac99475eb6e9e6d69a91fee30b5420b8e0115be Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 4 Jun 2015 13:46:34 -0400 Subject: [PATCH] Stabilize results of brin regression test. This test used seqscans on tenk1, with LIMIT, to build test data. That works most of the time, but if the synchronized-seqscan logic kicks in, we get varying test data. This seems likely to explain the erratic test failures on buildfarm member chipmunk, which uses smaller-than-default shared_buffers. To fix, add ORDER BY clauses to force the ordering to be what it was implicitly being assumed to be. Peter Geoghegan had noticed this with respect to one of the trouble spots, though not the ones actually causing the chipmunk issue. --- src/test/regress/expected/brin.out | 6 +++--- src/test/regress/sql/brin.sql | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/regress/expected/brin.out b/src/test/regress/expected/brin.out index 2be4b7ca3f..ba0824428e 100644 --- a/src/test/regress/expected/brin.out +++ b/src/test/regress/expected/brin.out @@ -55,13 +55,13 @@ INSERT INTO brintest SELECT int4range(thousand, twothousand), format('%s/%s%s', odd, even, tenthous)::pg_lsn, box(point(odd, even), point(thousand, twothousand)) -FROM tenk1 LIMIT 100; +FROM tenk1 ORDER BY unique2 LIMIT 100; -- throw in some NULL's and different values INSERT INTO brintest (inetcol, cidrcol, int4rangecol) SELECT inet 'fe80::6e40:8ff:fea9:8c46' + tenthous, cidr 'fe80::6e40:8ff:fea9:8c46' + tenthous, 'empty'::int4range -FROM tenk1 LIMIT 25; +FROM tenk1 ORDER BY thousand, tenthous LIMIT 25; CREATE INDEX brinidx ON brintest USING brin ( byteacol, charcol, @@ -238,7 +238,7 @@ INSERT INTO brintest SELECT int4range(thousand, twothousand), format('%s/%s%s', odd, even, tenthous)::pg_lsn, box(point(odd, even), point(thousand, twothousand)) -FROM tenk1 LIMIT 5 OFFSET 5; +FROM tenk1 ORDER BY unique2 LIMIT 5 OFFSET 5; VACUUM brintest; -- force a summarization cycle in brinidx UPDATE brintest SET int8col = int8col * int4col; UPDATE brintest SET textcol = '' WHERE textcol IS NOT NULL; diff --git a/src/test/regress/sql/brin.sql b/src/test/regress/sql/brin.sql index f47ef04c43..881a13b1b0 100644 --- a/src/test/regress/sql/brin.sql +++ b/src/test/regress/sql/brin.sql @@ -56,14 +56,14 @@ INSERT INTO brintest SELECT int4range(thousand, twothousand), format('%s/%s%s', odd, even, tenthous)::pg_lsn, box(point(odd, even), point(thousand, twothousand)) -FROM tenk1 LIMIT 100; +FROM tenk1 ORDER BY unique2 LIMIT 100; -- throw in some NULL's and different values INSERT INTO brintest (inetcol, cidrcol, int4rangecol) SELECT inet 'fe80::6e40:8ff:fea9:8c46' + tenthous, cidr 'fe80::6e40:8ff:fea9:8c46' + tenthous, 'empty'::int4range -FROM tenk1 LIMIT 25; +FROM tenk1 ORDER BY thousand, tenthous LIMIT 25; CREATE INDEX brinidx ON brintest USING brin ( byteacol, @@ -245,7 +245,7 @@ INSERT INTO brintest SELECT int4range(thousand, twothousand), format('%s/%s%s', odd, even, tenthous)::pg_lsn, box(point(odd, even), point(thousand, twothousand)) -FROM tenk1 LIMIT 5 OFFSET 5; +FROM tenk1 ORDER BY unique2 LIMIT 5 OFFSET 5; VACUUM brintest; -- force a summarization cycle in brinidx -- 2.40.0