Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 737cdc2

Browse files
committed
Fix bogus return macros in range_overright_internal().
PG_RETURN_BOOL() should only be used in functions following the V1 SQL function API. This coding accidentally fails to fail since letting the compiler coerce the Datum representation of bool back to plain bool does give the right answer; but that doesn't make it a good idea. Back-patch to older branches just to avoid unnecessary code divergence.
1 parent a068b5b commit 737cdc2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/rangetypes.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,12 @@ range_overright_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2)
917917

918918
/* An empty range is neither before nor after any other range */
919919
if (empty1 || empty2)
920-
PG_RETURN_BOOL(false);
920+
return false;
921921

922922
if (range_cmp_bounds(typcache, &lower1, &lower2) >= 0)
923-
PG_RETURN_BOOL(true);
923+
return true;
924924

925-
PG_RETURN_BOOL(false);
925+
return false;
926926
}
927927

928928
/* does not extend to left of? */

0 commit comments

Comments
 (0)