mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Fix bugs in comparison functions for multirange_bsearch_match()
Two functions multirange_range_overlaps_bsearch_comparison() and multirange_range_contains_bsearch_comparison() contain bugs of returning -1 instead of 1. This commit fixes these bugs and adds corresponding regression tests.
This commit is contained in:
@ -1660,7 +1660,7 @@ multirange_range_contains_bsearch_comparison(TypeCacheEntry *typcache,
|
||||
if (range_cmp_bounds(typcache, keyUpper, lower) < 0)
|
||||
return -1;
|
||||
if (range_cmp_bounds(typcache, keyLower, upper) > 0)
|
||||
return -1;
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* At this point we found overlapping range. But we have to check if it
|
||||
@ -1825,7 +1825,7 @@ multirange_range_overlaps_bsearch_comparison(TypeCacheEntry *typcache,
|
||||
if (range_cmp_bounds(typcache, keyUpper, lower) < 0)
|
||||
return -1;
|
||||
if (range_cmp_bounds(typcache, keyLower, upper) > 0)
|
||||
return -1;
|
||||
return 1;
|
||||
|
||||
*match = true;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user