Skip to content

Commit 4fb5c79

Browse files
committed
Cover brin/gin/gist/spgist ambuildempty routines in regression tests
Changing some TEMP or permanent tables to UNLOGGED is sufficient to invoke these ambuildempty routines, which were all not uncovered by any tests. These changes do not otherwise affect the test suite. Author: Amul Sul <sulamul@gmail.com> Discussion: https://postgr.es/m/CAAJ_b95nneRCLM-=qELEdgCYSk6W_++-C+Q_t+wH3SW-hF50iw@mail.gmail.com
1 parent 0bd5617 commit 4fb5c79

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/test/regress/expected/brin.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ ERROR: block number out of range: -1
484484
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
485485
ERROR: block number out of range: 4294967296
486486
-- test value merging in add_value
487-
CREATE TABLE brintest_2 (n numrange);
487+
CREATE UNLOGGED TABLE brintest_2 (n numrange);
488488
CREATE INDEX brinidx_2 ON brintest_2 USING brin (n);
489489
INSERT INTO brintest_2 VALUES ('empty');
490490
INSERT INTO brintest_2 VALUES (numrange(0, 2^1000::numeric));

src/test/regress/expected/gin.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ select count(*) > 0 as ok from gin_test_tbl where i @> array[1];
7474

7575
reset gin_fuzzy_search_limit;
7676
-- Test optimization of empty queries
77-
create temp table t_gin_test_tbl(i int4[], j int4[]);
77+
create unlogged table t_gin_test_tbl(i int4[], j int4[]);
7878
create index on t_gin_test_tbl using gin (i, j);
7979
insert into t_gin_test_tbl
8080
values

src/test/regress/expected/gist.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ reindex index gist_pointidx;
3636
--
3737
-- Test Index-only plans on GiST indexes
3838
--
39-
create table gist_tbl (b box, p point, c circle);
39+
create unlogged table gist_tbl (b box, p point, c circle);
4040
insert into gist_tbl
4141
select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)),
4242
point(0.05*i, 0.05*i),

src/test/regress/expected/spgist.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vacuum spgist_point_tbl;
2626
-- Test rescan paths (cf. bug #15378)
2727
-- use box and && rather than point, so that rescan happens when the
2828
-- traverse stack is non-empty
29-
create table spgist_box_tbl(id serial, b box);
29+
create unlogged table spgist_box_tbl(id serial, b box);
3030
insert into spgist_box_tbl(b)
3131
select box(point(i,j),point(i+s,j+s))
3232
from generate_series(1,100,5) i,

src/test/regress/sql/brin.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ SELECT brin_summarize_range('brin_summarize_idx', -1);
449449
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
450450

451451
-- test value merging in add_value
452-
CREATE TABLE brintest_2 (n numrange);
452+
CREATE UNLOGGED TABLE brintest_2 (n numrange);
453453
CREATE INDEX brinidx_2 ON brintest_2 USING brin (n);
454454
INSERT INTO brintest_2 VALUES ('empty');
455455
INSERT INTO brintest_2 VALUES (numrange(0, 2^1000::numeric));

src/test/regress/sql/gin.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ select count(*) > 0 as ok from gin_test_tbl where i @> array[1];
5252
reset gin_fuzzy_search_limit;
5353

5454
-- Test optimization of empty queries
55-
create temp table t_gin_test_tbl(i int4[], j int4[]);
55+
create unlogged table t_gin_test_tbl(i int4[], j int4[]);
5656
create index on t_gin_test_tbl using gin (i, j);
5757
insert into t_gin_test_tbl
5858
values

src/test/regress/sql/gist.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ reindex index gist_pointidx;
4141
-- Test Index-only plans on GiST indexes
4242
--
4343

44-
create table gist_tbl (b box, p point, c circle);
44+
create unlogged table gist_tbl (b box, p point, c circle);
4545

4646
insert into gist_tbl
4747
select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)),

src/test/regress/sql/spgist.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ vacuum spgist_point_tbl;
3434
-- use box and && rather than point, so that rescan happens when the
3535
-- traverse stack is non-empty
3636

37-
create table spgist_box_tbl(id serial, b box);
37+
create unlogged table spgist_box_tbl(id serial, b box);
3838
insert into spgist_box_tbl(b)
3939
select box(point(i,j),point(i+s,j+s))
4040
from generate_series(1,100,5) i,

0 commit comments

Comments
 (0)