From bf60906378a4d2308614aa3da5ee8c0584a4bef4 Mon Sep 17 00:00:00 2001 From: Chris Hodgson Date: Wed, 4 May 2011 23:56:34 +0000 Subject: [PATCH] merged changes r7092 to fix null handling in st_collect for #912, #630 in 1.5 branch into trunk git-svn-id: http://svn.osgeo.org/postgis/trunk@7093 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_functions_basic.c | 21 +++++++++++---------- regress/tickets.sql | 3 +++ regress/tickets_expected | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index f2a5c9457..bc4313c96 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -1252,19 +1252,20 @@ Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS) outtype = COLLECTIONTYPE; } - /* Advance NULL bitmap */ - if (bitmap) + count++; + } + + /* Advance NULL bitmap */ + if (bitmap) + { + bitmask <<= 1; + if (bitmask == 0x100) { - bitmask <<= 1; - if (bitmask == 0x100) - { - bitmap++; - bitmask = 1; - } + bitmap++; + bitmask = 1; } - - count++; } + } POSTGIS_DEBUGF(3, "LWGEOM_collect_garray: outtype = %d", outtype); diff --git a/regress/tickets.sql b/regress/tickets.sql index 54581395b..6ca704ecf 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -297,6 +297,9 @@ SELECT '#457.7', st_astext(st_collectionExtract('POLYGON((0 0, 1 0, 1 1, 0 1, 0 SELECT '#457.8', st_astext(st_collectionExtract('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))', 2)); SELECT '#457.9', st_astext(st_collectionExtract('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))', 3)); +-- #650 -- +SELECT '#650', ST_AsText(ST_Collect(ARRAY[ST_MakePoint(0,0), ST_MakePoint(1,1), null, ST_MakePoint(2,2)])); + -- #662 -- --SELECT '#662', ST_MakePolygon(ST_AddPoint(ST_AddPoint(ST_MakeLine(ST_SetSRID(ST_MakePointM(i+m,j,m),4326),ST_SetSRID(ST_MakePointM(j+m,i-m,m),4326)),ST_SetSRID(ST_MakePointM(i,j,m),4326)),ST_SetSRID(ST_MakePointM(i+m,j,m),4326))) As the_geom FROM generate_series(-10,50,20) As i CROSS JOIN generate_series(50,70, 20) As j CROSS JOIN generate_series(1,2) As m ORDER BY i, j, m, i*j*m LIMIT 1; diff --git a/regress/tickets_expected b/regress/tickets_expected index affef536e..ca2b989f6 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -81,6 +81,7 @@ NOTICE: IllegalArgumentException: Invalid number of points in LinearRing found #457.7| #457.8| #457.9|POLYGON((0 0,1 0,1 1,0 1,0 0)) +#650|MULTIPOINT(0 0,1 1,2 2) #667|SRID=4326;CURVEPOLYGON(CIRCULARSTRING(30 40,18.2842712474619 11.7157287525381,-9.99999999999994 0,-38.284271247462 68.2842712474618,30 40)) #677|1121395 #680|010100000000000000000024c00000000000004940 -- 2.50.1