Fix st_extent on empty relation (#1385)

git-svn-id: http://svn.osgeo.org/postgis/trunk@8451 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2011-12-18 14:22:43 +00:00
parent 6ef33c6d20
commit da36dfce37
3 changed files with 5 additions and 1 deletions

View file

@ -345,7 +345,7 @@ PG_FUNCTION_INFO_V1(BOX3D_combine);
Datum BOX3D_combine(PG_FUNCTION_ARGS)
{
BOX3D *box = (BOX3D*)PG_GETARG_POINTER(0);
GSERIALIZED *geom = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
GSERIALIZED *geom = PG_ARGISNULL(1) ? NULL : (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
LWGEOM *lwgeom = NULL;
BOX3D *result = NULL;
GBOX gbox;

View file

@ -458,6 +458,9 @@ SELECT '</#1320>';
-- #1344
select '#1344', ST_AsEWKB(st_makeline(g)) FROM ( values ('POINT(0 0)'::geometry ) ) as foo(g);
-- #1385
SELECT '#1385', ST_Extent(g) FROM ( select null::geometry as g ) as foo;
-- Clean up
DELETE FROM spatial_ref_sys;

View file

@ -141,3 +141,4 @@ ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)
#1320.geom.3|MULTIPOLYGON|4326
</#1320>
#1344|\001\002\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
#1385|