mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
Add BRIN test case
This test case was sketched in commit message 4c87010981
to explain an
ancient bug; it translates to a coverage increase, so add it to the BRIN
regression tests.
This commit is contained in:
parent
41c184bc64
commit
611ce856f5
@ -483,6 +483,25 @@ SELECT brin_summarize_range('brin_summarize_idx', -1);
|
||||
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 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));
|
||||
INSERT INTO brintest_2 VALUES ('(-1, 0)');
|
||||
SELECT brin_desummarize_range('brinidx', 0);
|
||||
brin_desummarize_range
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT brin_summarize_range('brinidx', 0);
|
||||
brin_summarize_range
|
||||
----------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
DROP TABLE brintest_2;
|
||||
-- test brin cost estimates behave sanely based on correlation of values
|
||||
CREATE TABLE brin_test (a INT, b INT);
|
||||
INSERT INTO brin_test SELECT x/100,x%100 FROM generate_series(1,10000) x(x);
|
||||
|
@ -448,6 +448,16 @@ SELECT brin_summarize_range('brin_summarize_idx', 4294967295);
|
||||
SELECT brin_summarize_range('brin_summarize_idx', -1);
|
||||
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
|
||||
|
||||
-- test value merging in add_value
|
||||
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));
|
||||
INSERT INTO brintest_2 VALUES ('(-1, 0)');
|
||||
|
||||
SELECT brin_desummarize_range('brinidx', 0);
|
||||
SELECT brin_summarize_range('brinidx', 0);
|
||||
DROP TABLE brintest_2;
|
||||
|
||||
-- test brin cost estimates behave sanely based on correlation of values
|
||||
CREATE TABLE brin_test (a INT, b INT);
|
||||
|
Loading…
Reference in New Issue
Block a user