diff --git a/src/test/regress/expected/brin.out b/src/test/regress/expected/brin.out index ae4c424e79..73fa38396e 100644 --- a/src/test/regress/expected/brin.out +++ b/src/test/regress/expected/brin.out @@ -484,7 +484,7 @@ ERROR: block number out of range: -1 SELECT brin_summarize_range('brin_summarize_idx', 4294967296); ERROR: block number out of range: 4294967296 -- test value merging in add_value -CREATE UNLOGGED TABLE brintest_2 (n numrange); +CREATE TABLE brintest_2 (n numrange); CREATE INDEX brinidx_2 ON brintest_2 USING brin (n); INSERT INTO brintest_2 VALUES ('empty'); INSERT INTO brintest_2 VALUES (numrange(0, 2^1000::numeric)); @@ -567,3 +567,8 @@ SELECT * FROM brintest_3 WHERE b < '0'; DROP TABLE brintest_3; RESET enable_seqscan; +-- test an unlogged table, mostly to get coverage of brinbuildempty +CREATE UNLOGGED TABLE brintest_unlogged (n numrange); +CREATE INDEX brinidx_unlogged ON brintest_unlogged USING brin (n); +INSERT INTO brintest_unlogged VALUES (numrange(0, 2^1000::numeric)); +DROP TABLE brintest_unlogged; diff --git a/src/test/regress/expected/gin.out b/src/test/regress/expected/gin.out index 1a0c3c6167..0af464309e 100644 --- a/src/test/regress/expected/gin.out +++ b/src/test/regress/expected/gin.out @@ -74,7 +74,7 @@ select count(*) > 0 as ok from gin_test_tbl where i @> array[1]; reset gin_fuzzy_search_limit; -- Test optimization of empty queries -create unlogged table t_gin_test_tbl(i int4[], j int4[]); +create temp table t_gin_test_tbl(i int4[], j int4[]); create index on t_gin_test_tbl using gin (i, j); insert into t_gin_test_tbl values @@ -288,3 +288,12 @@ select count(*) from t_gin_test_tbl where j @> '{}'::int[]; reset enable_seqscan; reset enable_bitmapscan; drop table t_gin_test_tbl; +-- test an unlogged table, mostly to get coverage of ginbuildempty +create unlogged table t_gin_test_tbl(i int4[], j int4[]); +create index on t_gin_test_tbl using gin (i, j); +insert into t_gin_test_tbl +values + (null, null), + ('{}', null), + ('{1}', '{2,3}'); +drop table t_gin_test_tbl; diff --git a/src/test/regress/expected/gist.out b/src/test/regress/expected/gist.out index a36b4c9c56..ae6c4adcdf 100644 --- a/src/test/regress/expected/gist.out +++ b/src/test/regress/expected/gist.out @@ -36,7 +36,7 @@ reindex index gist_pointidx; -- -- Test Index-only plans on GiST indexes -- -create unlogged table gist_tbl (b box, p point, c circle); +create table gist_tbl (b box, p point, c circle); insert into gist_tbl select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)), point(0.05*i, 0.05*i), @@ -392,3 +392,9 @@ reset enable_seqscan; reset enable_bitmapscan; reset enable_indexonlyscan; drop table gist_tbl; +-- test an unlogged table, mostly to get coverage of gistbuildempty +create unlogged table gist_tbl (b box); +create index gist_tbl_box_index on gist_tbl using gist (b); +insert into gist_tbl + select box(point(0.05*i, 0.05*i)) from generate_series(0,10) as i; +drop table gist_tbl; diff --git a/src/test/regress/expected/spgist.out b/src/test/regress/expected/spgist.out index f07b6f0145..2e91128560 100644 --- a/src/test/regress/expected/spgist.out +++ b/src/test/regress/expected/spgist.out @@ -26,7 +26,7 @@ vacuum spgist_point_tbl; -- Test rescan paths (cf. bug #15378) -- use box and && rather than point, so that rescan happens when the -- traverse stack is non-empty -create unlogged table spgist_box_tbl(id serial, b box); +create table spgist_box_tbl(id serial, b box); insert into spgist_box_tbl(b) select box(point(i,j),point(i+s,j+s)) from generate_series(1,100,5) i, @@ -41,7 +41,6 @@ select count(*) 3 (1 row) -drop table spgist_box_tbl; -- The point opclass's choose method only uses the spgMatchNode action, -- so the other actions are not tested by the above. Create an index using -- text opclass, which uses the others actions. @@ -87,3 +86,11 @@ select * from spgist_domain_tbl where f1 = 'fo'; fo (1 row) +-- test an unlogged table, mostly to get coverage of spgistbuildempty +create unlogged table spgist_unlogged_tbl(id serial, b box); +create index spgist_unlogged_idx on spgist_unlogged_tbl using spgist (b); +insert into spgist_unlogged_tbl(b) +select box(point(i,j)) + from generate_series(1,100,5) i, + generate_series(1,10,5) j; +-- leave this table around, to help in testing dump/restore diff --git a/src/test/regress/sql/brin.sql b/src/test/regress/sql/brin.sql index 33a30fcf77..e68e9e18df 100644 --- a/src/test/regress/sql/brin.sql +++ b/src/test/regress/sql/brin.sql @@ -449,7 +449,7 @@ SELECT brin_summarize_range('brin_summarize_idx', -1); SELECT brin_summarize_range('brin_summarize_idx', 4294967296); -- test value merging in add_value -CREATE UNLOGGED TABLE brintest_2 (n numrange); +CREATE TABLE brintest_2 (n numrange); CREATE INDEX brinidx_2 ON brintest_2 USING brin (n); INSERT INTO brintest_2 VALUES ('empty'); INSERT INTO brintest_2 VALUES (numrange(0, 2^1000::numeric)); @@ -509,3 +509,9 @@ SELECT * FROM brintest_3 WHERE b < '0'; DROP TABLE brintest_3; RESET enable_seqscan; + +-- test an unlogged table, mostly to get coverage of brinbuildempty +CREATE UNLOGGED TABLE brintest_unlogged (n numrange); +CREATE INDEX brinidx_unlogged ON brintest_unlogged USING brin (n); +INSERT INTO brintest_unlogged VALUES (numrange(0, 2^1000::numeric)); +DROP TABLE brintest_unlogged; diff --git a/src/test/regress/sql/gin.sql b/src/test/regress/sql/gin.sql index 746880937b..0c6905ba3b 100644 --- a/src/test/regress/sql/gin.sql +++ b/src/test/regress/sql/gin.sql @@ -52,7 +52,7 @@ select count(*) > 0 as ok from gin_test_tbl where i @> array[1]; reset gin_fuzzy_search_limit; -- Test optimization of empty queries -create unlogged table t_gin_test_tbl(i int4[], j int4[]); +create temp table t_gin_test_tbl(i int4[], j int4[]); create index on t_gin_test_tbl using gin (i, j); insert into t_gin_test_tbl values @@ -171,3 +171,13 @@ reset enable_seqscan; reset enable_bitmapscan; drop table t_gin_test_tbl; + +-- test an unlogged table, mostly to get coverage of ginbuildempty +create unlogged table t_gin_test_tbl(i int4[], j int4[]); +create index on t_gin_test_tbl using gin (i, j); +insert into t_gin_test_tbl +values + (null, null), + ('{}', null), + ('{1}', '{2,3}'); +drop table t_gin_test_tbl; diff --git a/src/test/regress/sql/gist.sql b/src/test/regress/sql/gist.sql index 3360266370..3dd7aa73c3 100644 --- a/src/test/regress/sql/gist.sql +++ b/src/test/regress/sql/gist.sql @@ -41,7 +41,7 @@ reindex index gist_pointidx; -- Test Index-only plans on GiST indexes -- -create unlogged table gist_tbl (b box, p point, c circle); +create table gist_tbl (b box, p point, c circle); insert into gist_tbl select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)), @@ -175,3 +175,10 @@ reset enable_bitmapscan; reset enable_indexonlyscan; drop table gist_tbl; + +-- test an unlogged table, mostly to get coverage of gistbuildempty +create unlogged table gist_tbl (b box); +create index gist_tbl_box_index on gist_tbl using gist (b); +insert into gist_tbl + select box(point(0.05*i, 0.05*i)) from generate_series(0,10) as i; +drop table gist_tbl; diff --git a/src/test/regress/sql/spgist.sql b/src/test/regress/sql/spgist.sql index d56b80a51b..4828ede68c 100644 --- a/src/test/regress/sql/spgist.sql +++ b/src/test/regress/sql/spgist.sql @@ -34,7 +34,7 @@ vacuum spgist_point_tbl; -- use box and && rather than point, so that rescan happens when the -- traverse stack is non-empty -create unlogged table spgist_box_tbl(id serial, b box); +create table spgist_box_tbl(id serial, b box); insert into spgist_box_tbl(b) select box(point(i,j),point(i+s,j+s)) from generate_series(1,100,5) i, @@ -45,7 +45,6 @@ create index spgist_box_idx on spgist_box_tbl using spgist (b); select count(*) from (values (point(5,5)),(point(8,8)),(point(12,12))) v(p) where exists(select * from spgist_box_tbl b where b.b && box(v.p,v.p)); -drop table spgist_box_tbl; -- The point opclass's choose method only uses the spgMatchNode action, -- so the other actions are not tested by the above. Create an index using @@ -81,3 +80,12 @@ insert into spgist_domain_tbl values('fee'), ('fi'), ('fo'), ('fum'); explain (costs off) select * from spgist_domain_tbl where f1 = 'fo'; select * from spgist_domain_tbl where f1 = 'fo'; + +-- test an unlogged table, mostly to get coverage of spgistbuildempty +create unlogged table spgist_unlogged_tbl(id serial, b box); +create index spgist_unlogged_idx on spgist_unlogged_tbl using spgist (b); +insert into spgist_unlogged_tbl(b) +select box(point(i,j)) + from generate_series(1,100,5) i, + generate_series(1,10,5) j; +-- leave this table around, to help in testing dump/restore