From: Sandro Santilli Date: Tue, 20 Dec 2011 18:51:54 +0000 (+0000) Subject: Different types _can_ be equal, see #756 X-Git-Tag: 2.0.0alpha1~394 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac0d3e3935a7deb9e9855b7e3a54628f88ba8a4b;p=postgis Different types _can_ be equal, see #756 git-svn-id: http://svn.osgeo.org/postgis/trunk@8480 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 974263a79..aeffa5b67 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -3032,10 +3032,6 @@ Datum geomequals(PG_FUNCTION_ARGS) errorIfGeometryCollection(geom1,geom2); error_if_srid_mismatch(gserialized_get_srid(geom1), gserialized_get_srid(geom2)); - /* Different types can't be equal */ - if( gserialized_get_type(geom1) != gserialized_get_type(geom2) ) - PG_RETURN_BOOL(FALSE); - /* Empty == Empty */ if ( gserialized_is_empty(geom1) && gserialized_is_empty(geom2) ) PG_RETURN_BOOL(TRUE); diff --git a/regress/tickets.sql b/regress/tickets.sql index 833da7828..3ab9a37f5 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -393,6 +393,14 @@ select '#711', ST_GeoHash(ST_GeomFromText('POLYGON EMPTY',4326)); -- #712 -- SELECT '#712',ST_IsValid(ST_GeomFromText('POLYGON EMPTY',4326)); +-- #756 +WITH inp AS ( SELECT 'LINESTRING(0 0, 1 1)'::geometry as s, + 'LINESTRING EMPTY'::geometry as e ) + SELECT '#756.1', ST_Equals(s, st_multi(s)), + ST_Equals(s, st_collect(s, e)) + FROM inp; + + -- #1023 -- select '#1023', 'POINT(10 4)'::geometry = 'POINT(10 4)'::geometry; select '#1023.a', 'POINT(10 4)'::geometry = 'POINT(10 5)'::geometry; diff --git a/regress/tickets_expected b/regress/tickets_expected index 1c7df0424..99e6cd0b0 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -115,6 +115,7 @@ ERROR: First argument must be a LINESTRING #668|BOX(10 2,14 2) #711| #712|t +#756.1|t|t #1023|t #1023.a|f #1023.b|t