[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0rc1-29-gdb710b834

git at osgeo.org git at osgeo.org
Mon Aug 14 08:24:03 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  db710b834e3b85187895ce0f70b5ee0b63c1a7dc (commit)
       via  3ed65b69cbe89de0b9a59cb04215c90bd01471df (commit)
       via  5235846efe61998247e74a08002bc45002641eb3 (commit)
       via  876963598ab3618a26edcfe183dd89c5df21735f (commit)
      from  f4348feb455a61fb47b577df9c7868971cd70e45 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit db710b834e3b85187895ce0f70b5ee0b63c1a7dc
Merge: 3ed65b69c 876963598
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Aug 14 08:21:24 2023 -0700

    Merge branch 'master-warnings'


commit 3ed65b69cbe89de0b9a59cb04215c90bd01471df
Merge: f4348feb4 5235846ef
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Aug 14 08:21:08 2023 -0700

    Merge branch 'master-5175'


commit 5235846efe61998247e74a08002bc45002641eb3
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 11 09:30:28 2023 -0700

    Add an explicit <> operator, closes #5175

diff --git a/postgis/lwgeom_btree.c b/postgis/lwgeom_btree.c
index bf3dd4922..df3fee1f6 100644
--- a/postgis/lwgeom_btree.c
+++ b/postgis/lwgeom_btree.c
@@ -43,6 +43,7 @@
 Datum lwgeom_lt(PG_FUNCTION_ARGS);
 Datum lwgeom_le(PG_FUNCTION_ARGS);
 Datum lwgeom_eq(PG_FUNCTION_ARGS);
+Datum lwgeom_neq(PG_FUNCTION_ARGS);
 Datum lwgeom_ge(PG_FUNCTION_ARGS);
 Datum lwgeom_gt(PG_FUNCTION_ARGS);
 Datum lwgeom_cmp(PG_FUNCTION_ARGS);
@@ -55,10 +56,7 @@ Datum lwgeom_lt(PG_FUNCTION_ARGS)
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp < 0)
-		PG_RETURN_BOOL(true);
-	else
-		PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(cmp < 0);
 }
 
 PG_FUNCTION_INFO_V1(lwgeom_le);
@@ -69,10 +67,7 @@ Datum lwgeom_le(PG_FUNCTION_ARGS)
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp <= 0)
-		PG_RETURN_BOOL(true);
-	else
-		PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(cmp <= 0);
 }
 
 PG_FUNCTION_INFO_V1(lwgeom_eq);
@@ -83,10 +78,18 @@ Datum lwgeom_eq(PG_FUNCTION_ARGS)
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp == 0)
-		PG_RETURN_BOOL(true);
-	else
-		PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(cmp == 0);
+}
+
+PG_FUNCTION_INFO_V1(lwgeom_neq);
+Datum lwgeom_neq(PG_FUNCTION_ARGS)
+{
+	GSERIALIZED *g1 = PG_GETARG_GSERIALIZED_P(0);
+	GSERIALIZED *g2 = PG_GETARG_GSERIALIZED_P(1);
+	int cmp = gserialized_cmp(g1, g2);
+	PG_FREE_IF_COPY(g1, 0);
+	PG_FREE_IF_COPY(g2, 1);
+	PG_RETURN_BOOL(cmp != 0);
 }
 
 PG_FUNCTION_INFO_V1(lwgeom_ge);
@@ -97,10 +100,7 @@ Datum lwgeom_ge(PG_FUNCTION_ARGS)
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp >= 0)
-		PG_RETURN_BOOL(true);
-	else
-		PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(cmp >= 0);
 }
 
 PG_FUNCTION_INFO_V1(lwgeom_gt);
@@ -111,10 +111,7 @@ Datum lwgeom_gt(PG_FUNCTION_ARGS)
 	int cmp = gserialized_cmp(g1, g2);
 	PG_FREE_IF_COPY(g1, 0);
 	PG_FREE_IF_COPY(g2, 1);
-	if (cmp > 0)
-		PG_RETURN_BOOL(true);
-	else
-		PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(cmp > 0);
 }
 
 PG_FUNCTION_INFO_V1(lwgeom_cmp);
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index c79ed40cb..af3ad2bab 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -398,6 +398,12 @@ CREATE OR REPLACE FUNCTION geometry_eq(geom1 geometry, geom2 geometry)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_DEFAULT;
 
+CREATE OR REPLACE FUNCTION geometry_neq(geom1 geometry, geom2 geometry)
+	RETURNS bool
+	AS 'MODULE_PATHNAME', 'lwgeom_neq'
+	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
+	_COST_DEFAULT;
+
 CREATE OR REPLACE FUNCTION geometry_cmp(geom1 geometry, geom2 geometry)
 	RETURNS integer
 	AS 'MODULE_PATHNAME', 'lwgeom_cmp'
@@ -431,7 +437,14 @@ CREATE OPERATOR <= (
 -- Availability: 0.9.0
 CREATE OPERATOR = (
 	LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_eq,
-	COMMUTATOR = '=', -- we might implement a faster negator here
+	COMMUTATOR = '=', NEGATOR = '<>',
+	RESTRICT = contsel, JOIN = contjoinsel, HASHES, MERGES
+);
+
+-- Availability: 3.5.0
+CREATE OPERATOR <> (
+	LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_neq,
+	COMMUTATOR = '<>', NEGATOR = '=',
 	RESTRICT = contsel, JOIN = contjoinsel, HASHES, MERGES
 );
 

commit 876963598ab3618a26edcfe183dd89c5df21735f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 8 11:30:03 2023 -0700

    Quiet persistent warnings on MacOS, where the postgres-detected int64 is "long" while the system provided int64_t is "long long" and the printf specifier thus mis-matches, even though the actual internal size of "long" and "long long" is identical.

diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c
index 01747aad8..f8b424afb 100644
--- a/topology/postgis_topology.c
+++ b/topology/postgis_topology.c
@@ -1407,7 +1407,7 @@ cb_getEdgeWithinDistance2D(const LWT_BE_TOPOLOGY *topo,
 {
   LWT_ISO_EDGE *edges;
   int spi_result;
-  int64_t elems_requested = limit;
+  int64 elems_requested = limit;
   char *hexewkb;
   MemoryContext oldcontext = CurrentMemoryContext;
   StringInfoData sqldata;
@@ -1510,7 +1510,7 @@ cb_getNodeWithinDistance2D(const LWT_BE_TOPOLOGY *topo,
   char *hexewkb;
   StringInfoData sqldata;
   StringInfo sql = &sqldata;
-  int64_t elems_requested = limit;
+  int64 elems_requested = limit;
   uint64_t i;
 
   initStringInfo(sql);
@@ -1645,8 +1645,8 @@ cb_insertNodes(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, uint64_t numele
   {
 	  cberror(topo->be_data,
 		  "processed " UINT64_FORMAT " rows, expected " UINT64_FORMAT,
-		  (uint64_t)SPI_processed,
-		  numelems);
+		  (uint64)SPI_processed,
+		  (uint64)numelems);
 	  return 0;
   }
 
@@ -1705,8 +1705,8 @@ cb_insertEdges(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t numele
   {
 	  cberror(topo->be_data,
 		  "processed " UINT64_FORMAT " rows, expected " UINT64_FORMAT,
-		  (uint64_t)SPI_processed,
-		  numelems);
+		  (uint64)SPI_processed,
+		  (uint64)numelems);
 	  return -1;
   }
 
@@ -1766,8 +1766,8 @@ cb_insertFaces(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numele
   {
 	  cberror(topo->be_data,
 		  "processed " UINT64_FORMAT " rows, expected " UINT64_FORMAT,
-		  (uint64_t)SPI_processed,
-		  numelems);
+		  (uint64)SPI_processed,
+		  (uint64)numelems);
 	  return -1;
   }
 
@@ -2154,7 +2154,7 @@ cb_getNextEdgeId( const LWT_BE_TOPOLOGY* topo )
 
   if ( SPI_processed != 1 )
   {
-	  cberror(topo->be_data, "processed " UINT64_FORMAT " rows, expected 1", (uint64_t)SPI_processed);
+	  cberror(topo->be_data, "processed " UINT64_FORMAT " rows, expected 1", (uint64)SPI_processed);
 	  return -1;
   }
 

-----------------------------------------------------------------------

Summary of changes:
 postgis/lwgeom_btree.c      | 37 +++++++++++++++++--------------------
 postgis/postgis.sql.in      | 15 ++++++++++++++-
 topology/postgis_topology.c | 18 +++++++++---------
 3 files changed, 40 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list