From f229b2e1bbbb89bc742561c1c6bf8380e8aa1698 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 22 Nov 2023 05:55:14 +0100 Subject: [PATCH] spherepoint_hash32: float8 needs wrapping into a Datum (#107) --- src/point.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/point.c b/src/point.c index f4df15c..26ae5f5 100644 --- a/src/point.c +++ b/src/point.c @@ -315,8 +315,8 @@ Datum spherepoint_hash32(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); - Datum h1 = DirectFunctionCall1(hashfloat8, p1->lat); - Datum h2 = DirectFunctionCall1(hashfloat8, p1->lng); + Datum h1 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lat)); + Datum h2 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lng)); PG_RETURN_INT32(DatumGetInt32(h1) ^ DatumGetInt32(h2)); }