[postgis-tickets] [SCM] PostGIS branch master updated. 5cf0d27f40e9ed1c1e7454aefc1757c6c7d03faa

git at osgeo.org git at osgeo.org
Tue Jan 14 11:13:58 PST 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, master has been updated
       via  5cf0d27f40e9ed1c1e7454aefc1757c6c7d03faa (commit)
      from  1152d813c0dbd00b61506908d8c0d78902a8ea43 (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 5cf0d27f40e9ed1c1e7454aefc1757c6c7d03faa
Author: Raúl Marín <git at rmr.ninja>
Date:   Tue Jan 14 20:13:52 2020 +0100

    ST_TileEnvelope: Simplify argument check

diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index c365162..4d0daa2 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2084,17 +2084,8 @@ Datum ST_TileEnvelope(PG_FUNCTION_ARGS)
 	srid = g->srid;
 	lwgeom_free(g);
 
-	if (PG_NARGS() < 4)
-	{
-		/* Avoid crashing with old signature (old sql code with 3 args, new C code with 4) */
-		ereport(ERROR,
-			(errcode(ERRCODE_UNDEFINED_PARAMETER),
-			 errmsg("Missing margin parameter ($4) in C function '%s'", __func__),
-			 errhint("Consider running: SELECT postgis_extensions_upgrade()")));
-		PG_RETURN_POINTER(NULL);
-	}
-
-	margin = PG_GETARG_FLOAT8(4);
+	/* Avoid crashing with old signature (old sql code with 3 args, new C code with 4) */
+	margin = PG_NARGS() < 4 ? 0 : PG_GETARG_FLOAT8(4);
 	/* shrinking by more than 50% would eliminate the tile outright */
 	if (margin < -0.5)
 		elog(ERROR, "%s: Margin must not be less than -50%%, margin=%f", __func__, margin);

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

Summary of changes:
 postgis/lwgeom_functions_basic.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list