]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Enlarge assertion in bloom_init() for false_positive_rate
authorMichael Paquier <michael@paquier.xyz>
Wed, 8 Nov 2023 05:06:36 +0000 (14:06 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 8 Nov 2023 05:06:36 +0000 (14:06 +0900)
commit4dccf9575369410f0c853e6f1b0b0579c8ec1c05
tree7a0774f632231aa186692b27ada70e2d2f915a68
parent3edc6580c0e27fb8f13322efd255a88d20dda6c2
Enlarge assertion in bloom_init() for false_positive_rate

false_positive_rate is a parameter that can be set with the bloom
opclass in BRIN, and setting it to a value of exactly 0.25 would trigger
an assertion in the first INSERT done on the index with value set.

The assertion changed here relied on BLOOM_{MIN|MAX}_FALSE_POSITIVE_RATE
that are somewhat arbitrary values, and specifying an out-of-range value
would also trigger a failure when defining such an index.  So, as-is,
the assertion was just doubling on the min-max check of the reloption.
This is now enlarged to check that it is a correct percentage value,
instead, based on a suggestion by Tom Lane.

Author: Alexander Lakhin
Reviewed-by: Tom Lane, Shihao Zhong
Discussion: https://postgr.es/m/17969-a6c54de48026d694@postgresql.org
Backpatch-through: 14
src/backend/access/brin/brin_bloom.c