[postgis-tickets] r17580 - Fix bug in lwgeom_le

Raul raul at rmr.ninja
Tue Jul 2 02:00:55 PDT 2019


Author: algunenano
Date: 2019-07-02 02:00:54 -0700 (Tue, 02 Jul 2019)
New Revision: 17580

Modified:
   trunk/NEWS
   trunk/postgis/lwgeom_btree.c
   trunk/regress/core/tickets.sql
   trunk/regress/core/tickets_expected
Log:
Fix bug in lwgeom_le

Closes #4445



Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2019-07-02 09:00:14 UTC (rev 17579)
+++ trunk/NEWS	2019-07-02 09:00:54 UTC (rev 17580)
@@ -6,6 +6,7 @@
 
 * Major highlights *
   - #4433 32-bit hash fix (requires reindexing hash(geometry) indexes) (Raúl Marín)
+  - #4445, Fix a bug in geometry_le (Raúl Marín)
 
 
 PostGIS 3.0.0alpha3
@@ -198,6 +199,7 @@
   - #4394, Allow FULL OUTER JOIN on geometry equality operator (Darafei Praliaskouski)
   - #4441, Make GiST penalty friendly to multi-column indexes and build single-column
            ones faster. (Darafei Praliaskouski)
+  - #4445, Fix a bug in geometry_le (Raúl Marín)
 
 
 PostGIS 2.5.0

Modified: trunk/postgis/lwgeom_btree.c
===================================================================
--- trunk/postgis/lwgeom_btree.c	2019-07-02 09:00:14 UTC (rev 17579)
+++ trunk/postgis/lwgeom_btree.c	2019-07-02 09:00:54 UTC (rev 17580)
@@ -68,7 +68,7 @@
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp == 0)
+	if (cmp <= 0)
 		PG_RETURN_BOOL(true);
 	else
 		PG_RETURN_BOOL(false);

Modified: trunk/regress/core/tickets.sql
===================================================================
--- trunk/regress/core/tickets.sql	2019-07-02 09:00:14 UTC (rev 17579)
+++ trunk/regress/core/tickets.sql	2019-07-02 09:00:54 UTC (rev 17580)
@@ -1248,3 +1248,24 @@
 SELECT '#4176', ST_Intersects('POLYGON((0 0, 10 10, 3 5, 0 0))', 'GEOMETRYCOLLECTION(POINT(10 10), LINESTRING(0 0, 3 3))');
 
 with mj as (select 'POINT(0 0)'::geometry geom) select '#4394' from mj a full join mj b on a.geom = b.geom;
+
+-- #4445 Geometry comparisons
+WITH p0 AS (SELECT 'POINT(0 0)'::geometry geom),
+     p1 AS (SELECT 'POINT(1 1)'::geometry geom)
+SELECT '#4445',
+       p0.geom  <    p0.geom,
+       p0.geom  <=   p0.geom,
+       p0.geom  =    p0.geom,
+       p0.geom  >=   p0.geom,
+       p0.geom  >    p0.geom,
+       p0.geom  <    p1.geom,
+       p0.geom  <=   p1.geom,
+       p0.geom  =    p1.geom,
+       p0.geom  >=   p1.geom,
+       p0.geom  >    p1.geom,
+       p1.geom  <    p0.geom,
+       p1.geom  <=   p0.geom,
+       p1.geom  =    p0.geom,
+       p1.geom  >=   p0.geom,
+       p1.geom  >    p0.geom
+FROM p0, p1;

Modified: trunk/regress/core/tickets_expected
===================================================================
--- trunk/regress/core/tickets_expected	2019-07-02 09:00:14 UTC (rev 17579)
+++ trunk/regress/core/tickets_expected	2019-07-02 09:00:54 UTC (rev 17580)
@@ -390,3 +390,4 @@
 ERROR:  BOX2D_construct: args can not be empty points
 #4176|t
 #4394
+#4445|f|t|t|t|f|t|t|f|f|f|f|f|f|t|t



More information about the postgis-tickets mailing list