[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.3-29-ge367c53

git at osgeo.org git at osgeo.org
Wed Jul 28 14:15:51 PDT 2021


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  e367c53c6b08339474161bf03f45d9691f7cee14 (commit)
       via  bd77ef8b48df07552adc41d4a8c932b07ab79426 (commit)
      from  7031983603c0b173b0ec629a27db34b9ff70f456 (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 e367c53c6b08339474161bf03f45d9691f7cee14
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 28 14:15:45 2021 -0700

    News entry for #4919

diff --git a/NEWS b/NEWS
index 2fbae1b..8f1063d 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ PostGIS 3.0.4dev
   - #4949, Swapped coordinates for N/E planar systems (Paul Ramsey)
   - #4326, Fix CircularPolygon area calculation (Paul Ramsey)
   - #4917, Fix crasher with '-' regclass (Paul Ramsey)
+  - #4919, Rare crash in selectivity calculation (Paul Ramsey)
 
 
 PostGIS 3.0.3

commit bd77ef8b48df07552adc41d4a8c932b07ab79426
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 28 14:06:57 2021 -0700

    Catch crash when query somehow sneaks a NULL query into the selectivity calculator, references #4919

diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
index aaf1976..f94441c 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -2234,6 +2234,7 @@ gserialized_sel_internal(PlannerInfo *root, List *args, int varRelid, int mode)
 
 	GBOX search_box;
 	float8 selectivity = 0;
+	Const *otherConst;
 
 	POSTGIS_DEBUGF(2, "%s: entered function", __func__);
 
@@ -2250,7 +2251,15 @@ gserialized_sel_internal(PlannerInfo *root, List *args, int varRelid, int mode)
 		return DEFAULT_ND_SEL;
 	}
 
-	if (!gserialized_datum_get_gbox_p(((Const*)other)->constvalue, &search_box))
+	otherConst = (Const*)other;
+	if ((!otherConst) || otherConst->constisnull)
+	{
+		ReleaseVariableStats(vardata);
+		POSTGIS_DEBUGF(2, "%s: constant argument is NULL", __func__);
+		return DEFAULT_ND_SEL;
+	}
+
+	if (!gserialized_datum_get_gbox_p(otherConst->constvalue, &search_box))
 	{
 		ReleaseVariableStats(vardata);
 		POSTGIS_DEBUGF(2, "%s: search box is EMPTY", __func__);

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

Summary of changes:
 NEWS                           |  1 +
 postgis/gserialized_estimate.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list