From bbe78f6c6c07aa84c6af006bf3373ff25fd4938e Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Mon, 24 Nov 2008 11:04:44 +0000 Subject: [PATCH] Fix for GBT#73: ST_Force_Collection crashes with CIRCULARSTRING. This is basically the same fix for GBT#66: ST_Dump kills backend when fed CIRCULAR STRING except that it occurs in a different place. git-svn-id: http://svn.osgeo.org/postgis/trunk@3325 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_functions_basic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lwgeom/lwgeom_functions_basic.c b/lwgeom/lwgeom_functions_basic.c index 7d2359f3b..b3df58045 100644 --- a/lwgeom/lwgeom_functions_basic.c +++ b/lwgeom/lwgeom_functions_basic.c @@ -1460,7 +1460,7 @@ Datum LWGEOM_force_collection(PG_FUNCTION_ARGS) lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom)); /* alread a multi*, just make it a collection */ - if ( TYPE_GETTYPE(lwgeom->type) >= MULTIPOINTTYPE ) + if ( lwgeom_contains_subgeoms(TYPE_GETTYPE(lwgeom->type)) ) { TYPE_SETTYPE(lwgeom->type, COLLECTIONTYPE); } @@ -1506,7 +1506,7 @@ Datum LWGEOM_force_multi(PG_FUNCTION_ARGS) * in input. If bbox cache is not there we'll need to handle * automatic bbox addition FOR_COMPLEX_GEOMS. */ - if ( TYPE_GETTYPE(geom->type) >= MULTIPOINTTYPE && + if ( lwgeom_contains_subgeoms(TYPE_GETTYPE(geom->type)) && TYPE_HASBBOX(geom->type) ) { PG_RETURN_POINTER(geom); @@ -1517,7 +1517,7 @@ Datum LWGEOM_force_multi(PG_FUNCTION_ARGS) type = TYPE_GETTYPE(lwgeom->type); /* single geom, make it a multi */ - if ( type < MULTIPOINTTYPE ) + if ( ! lwgeom_contains_subgeoms(type) ) { type += 3; SRID = lwgeom->SRID; -- 2.49.0