Content-Length: 276327 | pFad | http://github.com/postgrespro/postgres_cluster/commit/b538c90b1bded5464787e2b8e4431302d24eb601

18 Fix error in commit e6feef57. · postgrespro/postgres_cluster@b538c90 · GitHub
Skip to content

Commit b538c90

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 70a33b2 commit b538c90

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
@@ -1431,13 +1431,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
14311431
if (empty)
14321432
PG_RETURN_RANGE_P(r);
14331433

1434-
if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
1434+
if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
1435+
!lower.inclusive)
14351436
{
14361437
lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
14371438
lower.inclusive = true;
14381439
}
14391440

1440-
if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
1441+
if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
1442+
upper.inclusive)
14411443
{
14421444
upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
14431445
upper.inclusive = false;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/b538c90b1bded5464787e2b8e4431302d24eb601

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy