[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-863-g6febe57e7

git at osgeo.org git at osgeo.org
Tue May 17 15:22:57 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, master has been updated
       via  6febe57e76d2239ea9779c489eff376f3ed76e72 (commit)
      from  5cff5f7777e1562129799f4b479bbfdb218baa28 (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 6febe57e76d2239ea9779c489eff376f3ed76e72
Author: Regina Obe <lr at pcorp.us>
Date:   Tue May 17 18:19:46 2022 -0400

    Return error on ST_SetPoint emtpy linestring.
    References #5151 for PostGIS 3.3.0
    Have berrie stop on any 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
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index 45265cee1..1bf6f0bc4 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2449,6 +2449,12 @@ 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 221a62ebf..89a817cb9 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1435,3 +1435,6 @@ SELECT
 
 -- https://trac.osgeo.org/postgis/ticket/5024
 --SELECT '#5024', 'spatial_ref_sys entries' AS table_name, count(*) FROM spatial_ref_sys;
+
+-- 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 d1548b4bd..1dea7e91d 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -460,3 +460,4 @@ ERROR:  LWGEOM_addpoint: Invalid offset
 #4770.c|MULTIPOINT((0 0),(1 1))|602
 #4799|{"type": "Feature", "geometry": {"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:25832"}},"coordinates":[359667,5651729]}, "properties": {"id": 1, "geom1": {"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:3035"}},"coordinates":[4110471,3103061]}}}
 #5008|f|f
+ERROR:  Line has no points

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

Summary of changes:
 ci/berrie/postgis_regress.sh     | 1 +
 postgis/lwgeom_functions_basic.c | 6 ++++++
 regress/core/tickets.sql         | 3 +++
 regress/core/tickets_expected    | 1 +
 4 files changed, 11 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list