Skip to content

Commit 812623b

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 2be3554 commit 812623b

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
@@ -1338,13 +1338,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
13381338
if (empty)
13391339
PG_RETURN_RANGE(r);
13401340

1341-
if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
1341+
if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
1342+
!lower.inclusive)
13421343
{
13431344
lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
13441345
lower.inclusive = true;
13451346
}
13461347

1347-
if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
1348+
if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
1349+
upper.inclusive)
13481350
{
13491351
upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
13501352
upper.inclusive = false;

0 commit comments

Comments
 (0)