]> granicus.if.org Git - postgis/commitdiff
Made accum(geometry) compatible with PG73.
authorSandro Santilli <strk@keybit.net>
Fri, 7 Jan 2005 14:42:53 +0000 (14:42 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 7 Jan 2005 14:42:53 +0000 (14:42 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1258 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_functions_basic.c

index 1f8aaa7b73ced92c736e0eb40790607f0acc1d56..83d05ff369cd10b2141d746b7bebb0fbcfa8ec21 100644 (file)
@@ -1663,6 +1663,14 @@ Datum LWGEOM_accum(PG_FUNCTION_ARGS)
        Datum datum;
        PG_LWGEOM *geom;
        ArrayType *result;
+#if USE_VERSION > 72
+# if USE_VERSION == 73
+       Oid oid = getGeometryOID();
+# else  // USE_VERSION > 73
+       Oid oid = get_fn_expr_argtype(fcinfo->flinfo, 1);
+# endif // USE_VERSION > 73
+#endif // USE_VERSION > 72
+
 
 #ifdef DEBUG
        elog(NOTICE, "LWGEOM_accum called");
@@ -1697,7 +1705,6 @@ Datum LWGEOM_accum(PG_FUNCTION_ARGS)
        /* Make a DETOASTED copy of input geometry */
        geom = (PG_LWGEOM *)PG_DETOAST_DATUM(datum);
 
-
        /*
         * Might use a more optimized version instead of lwrealloc'ing
         * at every iteration. This is not the bottleneck anyway.
@@ -1719,14 +1726,9 @@ Datum LWGEOM_accum(PG_FUNCTION_ARGS)
 
                result->size = nbytes;
                result->ndim = 1;
-/*
- * TODO: PG73 require array to contain ->elemtype, but
- * does not contain the argument types in FmgrInfo.
- * We need a way to obtain 'geometry' type oid.
- */
 
-#if USE_VERSION > 73
-               result->elemtype = get_fn_expr_argtype(fcinfo->flinfo, 1);
+#if USE_VERSION > 72
+               result->elemtype = oid;
 #endif
                memcpy(ARR_DIMS(result), &nelems, sizeof(int));
                memcpy(ARR_LBOUND(result), &lbs, sizeof(int));