Fix GiST contained-by scans of multiranges GiST stores a multirange leaf key as its union range. When both the indexed value and the query have gaps, the indexed multirange can be contained by the query even though its union range is not. The current leaf check can therefore discard a matching row before heap recheck.
Implement a special test function for this case. Union range of query multirange must contain the leaf key union range. Back-patch to all supported branches. Reported-by: Peter Geoghegan <[email protected]> Discussion: https://postgr.es/m/CAH2-Wzm1GpQ9qixP=Xs2TYdfnLM88OZ=yufhnuajs_w7u90...@mail.gmail.com Author: Andrey Borodin <[email protected]> Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b0c881b934f1e975cf8a1678c8bd2d0716ac1be4 Modified Files -------------- src/backend/utils/adt/rangetypes_gist.c | 55 ++++++++++++++++++++++++++- src/test/regress/expected/multirangetypes.out | 12 ++++++ src/test/regress/sql/multirangetypes.sql | 2 + 3 files changed, 67 insertions(+), 2 deletions(-)
