From 62ec1d1e2248d9ea4938de830c0bbde380d44a7f Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 15 Dec 2011 23:29:39 +0000 Subject: [PATCH] Allow calling geography_in with less than 3 args (see #1320) git-svn-id: http://svn.osgeo.org/postgis/trunk@8432 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geography_inout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/postgis/geography_inout.c b/postgis/geography_inout.c index 28af7c37c..bcd80d5a5 100644 --- a/postgis/geography_inout.c +++ b/postgis/geography_inout.c @@ -82,11 +82,15 @@ Datum geography_in(PG_FUNCTION_ARGS) { char *str = PG_GETARG_CSTRING(0); /* Datum geog_oid = PG_GETARG_OID(1); Not needed. */ - int32 geog_typmod = PG_GETARG_INT32(2); + int32 geog_typmod = -1; LWGEOM_PARSER_RESULT lwg_parser_result; LWGEOM *lwgeom = NULL; GSERIALIZED *g_ser = NULL; + if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) { + geog_typmod = PG_GETARG_INT32(2); + } + lwgeom_parser_result_init(&lwg_parser_result); /* Empty string. */ -- 2.40.0