]> granicus.if.org Git - postgis/commitdiff
Have geography typmod threat unkonwn srid an omitted srid (#1482)
authorSandro Santilli <strk@keybit.net>
Wed, 18 Jan 2012 10:17:24 +0000 (10:17 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 18 Jan 2012 10:17:24 +0000 (10:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8864 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/gserialized_typmod.c
regress/tickets.sql
regress/tickets_expected

index da2acb8c6e9aa58dd585449e4079bb25196e6d58..72e400ba103d852057f61e7cac1362ccbe769df9 100644 (file)
@@ -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 */
                }
        }
 
index 56f6d870d06a43c4eb80729b2af9d08111ac01e4..8cf002018919a1addb9d6490aeda42ddf96b52b6 100644 (file)
@@ -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;
 
index de2316cb534fd95b18ca8231c9f64085da89b893..16787e13997f24215db8f52badff2329ca199e9a 100644 (file)
@@ -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