Skip to content

Commit d9c5b9a

Browse files
committed
Fix bug in brin_minmax_multi_union
When calling sort_expanded_ranges() we need to remember the return value, because the function sorts and also deduplicates the ranges. So the number of ranges may decrease. brin_minmax_multi_union failed to do that, which resulted in crashes due to bogus ranges (equal minval/maxval but not marked as compacted). Reported-by: Jaime Casanova Discussion: https://postgr.es/m/20210404052550.GA4376%40ahch-to
1 parent 4908684 commit d9c5b9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/brin/brin_minmax_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ brin_minmax_multi_union(PG_FUNCTION_ARGS)
27942794
BTLessStrategyNumber);
27952795

27962796
/* sort the expanded ranges */
2797-
sort_expanded_ranges(cmpFn, colloid, eranges, neranges);
2797+
neranges = sort_expanded_ranges(cmpFn, colloid, eranges, neranges);
27982798

27992799
/*
28002800
* We've loaded two different lists of expanded ranges, so some of them

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy