From 7aab7a38921a26e8fc66e6a2b503942200b96dcd Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 15 Nov 2023 11:27:27 +0100 Subject: [PATCH] spherepoint_hash32: float8 needs wrapping into a Datum --- 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)); }