From: Sandro Santilli Date: Wed, 18 Jan 2012 10:17:24 +0000 (+0000) Subject: Have geography typmod threat unkonwn srid an omitted srid (#1482) X-Git-Tag: 2.0.0alpha1~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19351fbc0eacf08f7d83fd9b01f580b193a3b30d;p=postgis Have geography typmod threat unkonwn srid an omitted srid (#1482) git-svn-id: http://svn.osgeo.org/postgis/trunk@8864 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/gserialized_typmod.c b/postgis/gserialized_typmod.c index da2acb8c6..72e400ba1 100644 --- a/postgis/gserialized_typmod.c +++ b/postgis/gserialized_typmod.c @@ -257,15 +257,17 @@ static uint32 gserialized_typmod_in(ArrayType *arr, int is_geography) TYPMOD_SET_SRID(typmod, srid); } } +#if 0 /* keep the default instead */ else { if ( is_geography ) { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("Negative SRID is not for GEOGRAPHY"))); - } + errmsg("UNKNOWN SRID is not for GEOGRAPHY"))); + } } +#endif /* keep the default for unknown */ } } diff --git a/regress/tickets.sql b/regress/tickets.sql index 56f6d870d..8cf002018 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -530,6 +530,9 @@ SELECT '#745', ST_AsEWKT(ST_Split('POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1) -- #1450 SELECT '#1450', GeometryType('POINT(0 0)'::geography), GeometryType('POLYGON EMPTY'::geography); +-- #1482 +select '#1482', ST_Srid('POINT(0 0)'::geography(point, 0)::geometry); + -- Clean up DELETE FROM spatial_ref_sys; diff --git a/regress/tickets_expected b/regress/tickets_expected index de2316cb5..16787e139 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -176,3 +176,4 @@ ERROR: MultiSurface cannot contain MultiPoint element #1478|01040000200100000000000000 #745|GEOMETRYCOLLECTION(POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1))) #1450|POINT|POLYGON +#1482|4326