[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.3-15-g5c1e53f

git at osgeo.org git at osgeo.org
Wed Jul 28 14:15:05 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.1 has been updated
       via  5c1e53fdb9ed7417bfaec0f0025bada44009b3eb (commit)
       via  bbf341d43ecd34786a2435e89f8c1654f0e2ffd1 (commit)
      from  8cd3038e55fb2c36d53d617871574b1eea71db98 (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 5c1e53fdb9ed7417bfaec0f0025bada44009b3eb
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 28 14:15:00 2021 -0700

    News entry for #4919

diff --git a/NEWS b/NEWS
index 6d67ee4..dc63adc 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ PostGIS 3.1.4dev
   - GI617, Fix typo in setting of INVMINDIST (Charles Karney)
   - #4326, Fix CircularPolygon area calculation (Paul Ramsey)
   - #4917, Fix crasher with '-' regclass (Paul Ramsey)
+  - #4919, Rare crash in selectivity calculation (Paul Ramsey)
 
 
 PostGIS 3.1.3

commit bbf341d43ecd34786a2435e89f8c1654f0e2ffd1
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 0ca42a3..4fa6932 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -2240,6 +2240,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__);
 
@@ -2256,7 +2257,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