mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03: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:
@ -483,6 +483,25 @@ SELECT brin_summarize_range('brin_summarize_idx', -1);
|
|||||||
ERROR: block number out of range: -1
|
ERROR: block number out of range: -1
|
||||||
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
|
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
|
||||||
ERROR: block number out of range: 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
|
-- test brin cost estimates behave sanely based on correlation of values
|
||||||
CREATE TABLE brin_test (a INT, b INT);
|
CREATE TABLE brin_test (a INT, b INT);
|
||||||
INSERT INTO brin_test SELECT x/100,x%100 FROM generate_series(1,10000) x(x);
|
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', -1);
|
||||||
SELECT brin_summarize_range('brin_summarize_idx', 4294967296);
|
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
|
-- test brin cost estimates behave sanely based on correlation of values
|
||||||
CREATE TABLE brin_test (a INT, b INT);
|
CREATE TABLE brin_test (a INT, b INT);
|
||||||
|
Reference in New Issue
Block a user