Skip to content

Commit b0a7e0f

Browse files
committed
Fix error in commit e6feef5.
I was careless passing a datum directly to DATE_NOT_FINITE without calling DatumGetDateADT() first. Backpatch-through: 9.4
1 parent 955089d commit b0a7e0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/utils/adt/rangetypes.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,13 +1366,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
13661366
if (empty)
13671367
PG_RETURN_RANGE(r);
13681368

1369-
if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
1369+
if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
1370+
!lower.inclusive)
13701371
{
13711372
lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
13721373
lower.inclusive = true;
13731374
}
13741375

1375-
if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
1376+
if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
1377+
upper.inclusive)
13761378
{
13771379
upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
13781380
upper.inclusive = false;

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