[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.1-12-gc3a45a7
git at osgeo.org
git at osgeo.org
Tue Apr 21 08:23:28 PDT 2020
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.0 has been updated
via c3a45a7f7b3f56aa97cb4066c99321f52c145948 (commit)
from 72fc4cd802b0b4a69c2e0e6a0ac37f01315ef83c (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 c3a45a7f7b3f56aa97cb4066c99321f52c145948
Author: Raúl Marín <git at rmr.ninja>
Date: Tue Apr 21 16:41:19 2020 +0200
ST_AddPoint: Fix bug when a positive position is requested
References #4670
Introduced in #4599, so backpatching through 2.5
diff --git a/NEWS b/NEWS
index 39ecad0..5619c63 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ PostGIS 3.0.2
* Bug Fixes and Enhancements *
- #4652, Fix several memory related bugs in ST_GeomFromGML (Raúl Marín)
- #4661, Fix access to spatial_ref_sys with a non default schema (Raúl Marín)
-
+ - #4670, ST_AddPoint: Fix bug when a positive position is requested (Raúl Marín)
PostGIS 3.0.1
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index cf1bf20..f76fb3e 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2216,9 +2216,13 @@ Datum LWGEOM_addpoint(PG_FUNCTION_ARGS)
}
else if (where < 0 || where > (int32)line->points->npoints)
{
- elog(ERROR, "Invalid offset");
+ elog(ERROR, "%s: Invalid offset", __func__);
PG_RETURN_NULL();
}
+ else
+ {
+ uwhere = where;
+ }
}
point = lwgeom_as_lwpoint(lwgeom_from_gserialized(pglwg2));
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 4e1b3e0..842bd07 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1288,3 +1288,10 @@ select '#4399', 'ST_AsGeoJSON', ST_AsGeoJSON(geom)::text from geom;
SELECT '#4599-1', ST_AsEWKT(ST_AddPoint(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)'), ST_MakePoint(1, 2, 3)));
SELECT '#4599-2', ST_AsEWKT(ST_AddPoint(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)'), ST_MakePoint(1, 2, 3), 0));
SELECT '#4599-3', ST_AsEWKT(ST_AddPoint(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)'), ST_MakePoint(1, 2, 3), -1));
+
+SELECT '#4670-0', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 0));
+SELECT '#4670-1', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 1));
+SELECT '#4670-2', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 2));
+SELECT '#4670-3', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 3));
+SELECT '#4670-4', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 4));
+SELECT '#4670-5', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 5));
\ No newline at end of file
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 4b34ba7..fbf9316 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -427,3 +427,9 @@ ERROR: BOX2D_construct: args can not be empty points
#4599-1|LINESTRING(0 0 1,1 1 1,1 2 3)
#4599-2|LINESTRING(1 2 3,0 0 1,1 1 1)
#4599-3|LINESTRING(0 0 1,1 1 1,1 2 3)
+#4670-0|LINESTRING(2 2,0 0,1 1,3 3,4 4)
+#4670-1|LINESTRING(0 0,2 2,1 1,3 3,4 4)
+#4670-2|LINESTRING(0 0,1 1,2 2,3 3,4 4)
+#4670-3|LINESTRING(0 0,1 1,3 3,2 2,4 4)
+#4670-4|LINESTRING(0 0,1 1,3 3,4 4,2 2)
+ERROR: LWGEOM_addpoint: Invalid offset
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 +-
postgis/lwgeom_functions_basic.c | 6 +++++-
regress/core/tickets.sql | 7 +++++++
regress/core/tickets_expected | 6 ++++++
4 files changed, 19 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list