[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.7-6-gdc920869d
git at osgeo.org
git at osgeo.org
Mon Oct 3 20:31:24 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.0 has been updated
via dc920869de1575f4799e0b9e484ae7a193188459 (commit)
via 64beb96f2bee5b27fefecd109a5cbb4e01bff15b (commit)
from 4f3aec70c3a26546ff97e7508b5ea024b7d7943f (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 dc920869de1575f4799e0b9e484ae7a193188459
Author: Regina Obe <lr at pcorp.us>
Date: Mon Oct 3 23:30:46 2022 -0400
ST_DumpPoints crash with empty polygon
Closes #5240 for PostGIS 3.0.8
diff --git a/NEWS b/NEWS
index 370c9d9e5..c3c418d12 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ YYYY/MM/DD
* Bug Fixes*
- Add schema qual to upgrade util
+ - #5240, ST_DumpPoints crash with empty polygon (Regina Obe)
PostGIS 3.0.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 64beb96f2bee5b27fefecd109a5cbb4e01bff15b
Author: Regina Obe <lr at pcorp.us>
Date: Mon Oct 3 23:30:13 2022 -0400
Add schema qual to upgrade util for PostGIS 3.0.8
diff --git a/NEWS b/NEWS
index b4ebc9448..370c9d9e5 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ PostGIS 3.0.8dev
YYYY/MM/DD
* Bug Fixes*
- - ...
+ - Add schema qual to upgrade util
PostGIS 3.0.7
2022/08/18
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index a011b3e11..d48a5a6e3 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -283,7 +283,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