[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.7-6-geb992fb15
git at osgeo.org
git at osgeo.org
Mon Oct 3 18:05:13 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 eb992fb157a6eb36a9eca0840edf1219e873d202 (commit)
via c0b1c9ac277316b88d81a768b3b9904b414c5998 (commit)
from 3a12995252864474680ee25aff7d4baa9c590a53 (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 eb992fb157a6eb36a9eca0840edf1219e873d202
Author: Regina Obe <lr at pcorp.us>
Date: Mon Oct 3 20:33:21 2022 -0400
ST_DumpPoints crash with empty polygon.
References #5420 for PostGIS 3.1.8
diff --git a/NEWS b/NEWS
index f043f4387..68639f9ee 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ YYYY/MM/DD
* Bug Fixes
- Add schema qual to upgrade util
+ - #5420, ST_DumpPoints crash with empty polygon (Regina Obe)
PostGIS 3.1.7
2022/08/18
diff --git a/postgis/lwgeom_dumppoints.c b/postgis/lwgeom_dumppoints.c
index fa94b7e8f..9955f8a06 100644
--- a/postgis/lwgeom_dumppoints.c
+++ b/postgis/lwgeom_dumppoints.c
@@ -162,6 +162,7 @@ Datum LWGEOM_dumppoints(PG_FUNCTION_ARGS) {
LWPOINT *lwpoint = NULL;
POINT4D pt;
+ if ( !lwgeom_is_empty(lwgeom) ) {
/*
* net result of switch should be to set lwpoint to the
* next point to return, or leave at NULL if there
@@ -233,12 +234,13 @@ Datum LWGEOM_dumppoints(PG_FUNCTION_ARGS) {
default:
ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
errmsg("Invalid Geometry type %d passed to ST_DumpPoints()", lwgeom->type)));
+ }
}
/*
* At this point, lwpoint is either NULL, in which case
* we need to pop the geometry stack and get the next
- * geometry, if amy, or lwpoint is set and we construct
+ * geometry, if any, or lwpoint is set and we construct
* a record type with the integer array of geometry
* indexes and the point number, and the actual point
* geometry itself
diff --git a/regress/core/dumppoints.sql b/regress/core/dumppoints.sql
index a6ecff640..e77cde5e8 100644
--- a/regress/core/dumppoints.sql
+++ b/regress/core/dumppoints.sql
@@ -183,3 +183,9 @@ SELECT '#2704', ST_DumpPoints('MULTIPOLYGON EMPTY'::geometry);
SELECT '#2704', ST_DumpPoints('MULTILINESTRING EMPTY'::geometry);
SELECT '#2704', ST_DumpPoints('LINESTRING EMPTY'::geometry);
SELECT '#2704', ST_DumpPoints('GEOMETRYCOLLECTION EMPTY'::geometry);
+
+SELECT '#5240', dp.path, ST_AsText(dp.geom)
+ FROM ( SELECT ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326) As the_geom ) As foo1, ST_DumpPoints(foo1.the_geom) AS dp;
+
+SELECT '#5240', dp.path, ST_AsText(dp.geom)
+ FROM ( SELECT ST_GeomFromText('MULTIPOLYGON (EMPTY, ((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)) )', 4326) As the_geom ) As foo1, ST_DumpPoints(foo1.the_geom) AS dp;
diff --git a/regress/core/dumppoints_expected b/regress/core/dumppoints_expected
index a1e9fc2a8..37f2d6753 100644
--- a/regress/core/dumppoints_expected
+++ b/regress/core/dumppoints_expected
@@ -100,3 +100,15 @@
{2,2}|POINT(3 3)
{2,3}|POINT(3 1)
{2,4}|POINT(1 1)
+#5240|{1,1,1}|POINT(9 9)
+#5240|{1,1,2}|POINT(9 1)
+#5240|{1,1,3}|POINT(1 1)
+#5240|{1,1,4}|POINT(2 4)
+#5240|{1,1,5}|POINT(7 7)
+#5240|{1,1,6}|POINT(9 9)
+#5240|{2,1,1}|POINT(9 9)
+#5240|{2,1,2}|POINT(9 1)
+#5240|{2,1,3}|POINT(1 1)
+#5240|{2,1,4}|POINT(2 4)
+#5240|{2,1,5}|POINT(7 7)
+#5240|{2,1,6}|POINT(9 9)
commit c0b1c9ac277316b88d81a768b3b9904b414c5998
Author: Regina Obe <lr at pcorp.us>
Date: Mon Oct 3 20:13:20 2022 -0400
Add missing schema qual to upgrade util
diff --git a/NEWS b/NEWS
index d1bc2bfe8..f043f4387 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ PostGIS 3.1.8dev
YYYY/MM/DD
* Bug Fixes
- - ...
+ - Add schema qual to upgrade util
PostGIS 3.1.7
2022/08/18
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index 611e8194e..c95b3a364 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -370,7 +370,7 @@ EOF
DO LANGUAGE 'plpgsql'
\$postgis_proc_upgrade\$
BEGIN
- IF current_setting('server_version_num')::integer >= 120000
+ IF pg_catalog.current_setting('server_version_num')::integer >= 120000
THEN
EXECUTE \$postgis_proc_upgrade_parsed_def\$ $pg12_def \$postgis_proc_upgrade_parsed_def\$;
ELSIF $last_updated > version_from_num OR (
-----------------------------------------------------------------------
Summary of changes:
NEWS | 3 ++-
postgis/lwgeom_dumppoints.c | 4 +++-
regress/core/dumppoints.sql | 6 ++++++
regress/core/dumppoints_expected | 12 ++++++++++++
utils/postgis_proc_upgrade.pl | 2 +-
5 files changed, 24 insertions(+), 3 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list