From 5a0d9d100885b9aaaa44aa3455769ed9687090a3 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Wed, 2 Sep 2015 17:49:55 +0000 Subject: [PATCH] #3220 patch from Dan Baston to address Mingw failure in ST_ClusterWithin git-svn-id: http://svn.osgeo.org/postgis/trunk@14035 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_accum.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/postgis/lwgeom_accum.c b/postgis/lwgeom_accum.c index 476566c0f..e89d22a0f 100644 --- a/postgis/lwgeom_accum.c +++ b/postgis/lwgeom_accum.c @@ -13,6 +13,7 @@ #include "fmgr.h" #include "funcapi.h" #include "access/tupmacs.h" +#include "utils/datum.h" #include "utils/array.h" #include "utils/lsyscache.h" @@ -130,7 +131,13 @@ pgis_geometry_accum_transfn(PG_FUNCTION_ARGS) if (PG_NARGS() == 3) { - p->data = PG_GETARG_DATUM(2); + Datum argument = PG_GETARG_DATUM(2); + Oid dataOid = get_fn_expr_argtype(fcinfo->flinfo, 2); + MemoryContext old = MemoryContextSwitchTo(aggcontext); + + p->data = datumCopy(argument, get_typbyval(dataOid), get_typlen(dataOid)); + + MemoryContextSwitchTo(old); } } else -- 2.50.0