[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.5-10-gc14e9a059

git at osgeo.org git at osgeo.org
Tue May 17 21:27:31 PDT 2022


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, stable-3.1 has been updated
       via  c14e9a059aca3ee39fdbfab88190da5172a81122 (commit)
       via  13bf5f18b8a06f49b76a06795e601dd0f8a18059 (commit)
       via  34d07134f7479b1a90bc195c7765e0425c234a86 (commit)
      from  2979ae7cca0e1960991276e9fb724bcbf369cc07 (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 c14e9a059aca3ee39fdbfab88190da5172a81122
Author: Regina Obe <lr at pcorp.us>
Date:   Wed May 18 00:26:06 2022 -0400

    Return error on ST_SetPoint emtpy linestring.
    References #5151 for PostGIS 3.1.6

diff --git a/NEWS b/NEWS
index 10da6e890..1f54a4460 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ PostGIS 3.1.6dev
   - #5076, Avoid log storm installed with pgaudit enabled (Paul Ramsey)
   - #5100, Stop using pg_atoi, removed in PG 15 (Laurenz Albe)
   - #5115, Allow dropping topologies with pending constraints (Sandro Santilli)
+  - #5151, ST_SetPoint with empty geometries (Regina Obe)
 
 PostGIS 3.1.5
 2022/02/01
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index 43b236bee..0a629912b 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2339,6 +2339,10 @@ Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS)
 		elog(ERROR, "First argument must be a LINESTRING");
 		PG_RETURN_NULL();
 	}
+	if ( line->points->npoints < 1 ) 	{
+		elog(ERROR, "Line has no points");
+		PG_RETURN_NULL();
+	}
 	if (which < 0)
 	{
 		/* Use backward indexing for negative values */
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index e07b50c7e..4e7e9933b 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1424,3 +1424,6 @@ WITH w AS (
 SELECT '#4770.c', ST_AsText(g), s FROM w;
 
 ------
+
+-- https://trac.osgeo.org/postgis/ticket/5151
+SELECT '#5151', ST_SetPoint(ST_GeomFromText('LINESTRING EMPTY',4326), 1, ST_GeomFromText('POINT(40 50)',4326)) As result;
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 91b8e7cc6..9939a6b97 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -460,3 +460,4 @@ ERROR:  LWGEOM_addpoint: Invalid offset
 #4770.b|POINT(1 1)|302
 #4770.c|POINT(0 0)|300
 #4770.c|MULTIPOINT(0 0,1 1)|602
+ERROR:  Line has no points

commit 13bf5f18b8a06f49b76a06795e601dd0f8a18059
Author: Regina Obe <lr at pcorp.us>
Date:   Wed May 18 00:25:55 2022 -0400

    Have berrie stop on first error

diff --git a/ci/berrie/postgis_regress.sh b/ci/berrie/postgis_regress.sh
index 88ccd964a..0573fd589 100644
--- a/ci/berrie/postgis_regress.sh
+++ b/ci/berrie/postgis_regress.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+set -e
 #bessie is a 32-bit Rasberry Pi managed by Bruce Rindahl
 ## BRANCH is passed in via jenkins which is set via gitea web hook
 #export BRANCH=618a67b1d6fc223dd5a4c0b02c824939f21dbd65

commit 34d07134f7479b1a90bc195c7765e0425c234a86
Author: Regina Obe <lr at pcorp.us>
Date:   Wed May 18 00:18:53 2022 -0400

    Better testing of empties and window functions. Also logic to not skip nested ref entries

diff --git a/doc/xsl/postgis_gardentest.sql.xsl b/doc/xsl/postgis_gardentest.sql.xsl
index c8629eb8e..8aec3efc1 100644
--- a/doc/xsl/postgis_gardentest.sql.xsl
+++ b/doc/xsl/postgis_gardentest.sql.xsl
@@ -238,6 +238,21 @@ FROM (VALUES ( ST_GeomFromEWKT('SRID=4326;MULTIPOLYGON(((-71.0821 42.3036 2,-71.
 		)
 		</pgis:gset>
 
+		<pgis:gset ID="Empty Linestring" GeometryType="LINESTRING" createtable="false">
+		(SELECT ST_GeomFromText('LINESTRING EMPTY',4326) As the_geom)
+		</pgis:gset>
+
+		<pgis:gset ID="Empty Point" GeometryType="POINT" createtable="false">
+		(SELECT ST_GeomFromText('POINT EMPTY',4326) As the_geom)
+		</pgis:gset>
+
+		<pgis:gset ID="Empty Polygon" GeometryType="POLYGON" createtable="false">
+		(SELECT ST_GeomFromText('POLYGON EMPTY',4326) As the_geom)
+		</pgis:gset>
+
+		<pgis:gset ID="Empty Geometry Collection" GeometryType="GEOMETRY" createtable="false">
+		 (SELECT ST_GeomFromText('GEOMETRYCOLLECTION EMPTY',4326) As the_geom )
+		</pgis:gset>
 
 		<pgis:gset ID="Empty Geometry Collection" GeometryType="GEOMETRY" createtable="false">
 		 (SELECT ST_GeomFromText('GEOMETRYCOLLECTION EMPTY',4326) As the_geom )
@@ -481,7 +496,7 @@ SELECT '<xsl:value-of select="$log_label" /> Geography: End Testing';
 	</xsl:for-each>
 <!--End test on operators -->
 <!-- Start regular function checks excluding operators -->
-		<xsl:for-each select="sect1[not(contains(@id,'Operator'))]/refentry">
+		<xsl:for-each select="sect1[not(contains(@id,'Operator'))]//refentry">
 		<xsl:sort select="@id"/>
 
 			<xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
@@ -511,11 +526,11 @@ SELECT '<xsl:value-of select="$log_label" /> Geography: End Testing';
 				  </xsl:choose>
 				</xsl:variable>
 
-				<!-- is a window function -->
+				<!-- is a window or aggregate function -->
 				<xsl:variable name='over_clause'>
 					 <xsl:choose>
-					 	<xsl:when test="paramdef/type[contains(text(),'winset')]">
-					 		<xsl:value-of select="'OVER()'"/>
+					 	<xsl:when test="paramdef/type[contains(text(),'set')]">
+					 		<xsl:value-of select="'OVER(ORDER BY random())'"/>
 					 	</xsl:when>
 					<xsl:otherwise>
 					  <xsl:value-of select="''"/>

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

Summary of changes:
 NEWS                               |  1 +
 ci/berrie/postgis_regress.sh       |  1 +
 doc/xsl/postgis_gardentest.sql.xsl | 23 +++++++++++++++++++----
 postgis/lwgeom_functions_basic.c   |  4 ++++
 regress/core/tickets.sql           |  3 +++
 regress/core/tickets_expected      |  1 +
 6 files changed, 29 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list