postgres.git / summary / log / commit / refs
commit 477ebfc9695e267d3f345a77211579236bcac91c
Author: Jeff Davis <jdavis@postgresql.org>
Date: Thu Jul 18 23:45:03 2019 +0000
Fix error in commit e6feef57.
I was careless passing a datum directly to DATE_NOT_FINITE without
calling DatumGetDateADT() first.
Backpatch-through: 9.4
src/backend/utils/adt/rangetypes.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index 5b28e74a593..558e7becc4e 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -1430,13 +1430,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
if (empty)
PG_RETURN_RANGE_P(r);
- if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
+ if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
+ !lower.inclusive)
{
lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
lower.inclusive = true;
}
- if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
+ if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
+ upper.inclusive)
{
upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
upper.inclusive = false;
[parent: f5f20deda33b]