]> granicus.if.org Git - postgis/commitdiff
#1869 take care of ST_AsBinary(unknown/text), ST_AsText(unknown/text) is not unique...
authorRegina Obe <lr@pcorp.us>
Sun, 25 Nov 2012 22:36:15 +0000 (22:36 +0000)
committerRegina Obe <lr@pcorp.us>
Sun, 25 Nov 2012 22:36:15 +0000 (22:36 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10737 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/legacy_minimal.sql.in.c
regress/legacy.sql
regress/legacy_expected

index b19ff65bdad06bfb5d79d2e284557a62c2c48a0d..8b68e4b1184f639f440742e87c83359ad929223d 100644 (file)
@@ -61,3 +61,20 @@ CREATE OR REPLACE FUNCTION SRID(geometry)
        AS 'MODULE_PATHNAME','LWGEOM_get_srid'
        LANGUAGE 'c' IMMUTABLE STRICT;
        
+-- Deprecation in 1.5.0
+-- hack to allow unknown to cast to geometry
+-- so does not yield function is not unique
+CREATE OR REPLACE FUNCTION ST_AsBinary(text)
+       RETURNS bytea
+       AS 
+       $$ SELECT ST_AsBinary($1::geometry);$$
+       LANGUAGE 'sql' IMMUTABLE STRICT;
+       
+-- Deprecation in 1.5.0
+-- hack to allow unknown to cast to geometry
+-- so does not yield function is not unique
+CREATE OR REPLACE FUNCTION ST_AsText(bytea)
+       RETURNS text
+       AS 
+       $$ SELECT ST_AsText($1::geometry);$$
+       LANGUAGE 'sql' IMMUTABLE STRICT;
index 89defe85cef15e17410e1387b925c3875f7e07d3..88899da0422c568e252f0c515824ac582bc0fd64 100644 (file)
@@ -49,6 +49,9 @@ DROP TABLE wmstest;
 DELETE FROM geometry_columns WHERE f_table_name = 'wmstest' AND f_table_schema = 'public';
 SELECT 'Done.';
 
+-- test #1869 ST_AsBinary is not unique --
+SELECT 1869 As ticket_id, ST_AsText(ST_AsBinary('POINT(1 2)'));
+
 DELETE FROM spatial_ref_sys WHERE SRID = '4326';
 
 \i 00-regress-install/share/contrib/postgis/uninstall_legacy.sql
index aac80c8b5018dd933b1fec268a63136fefd3421e..d6f34e48fe11335914667bec7a5fc271a58a4fce 100644 (file)
@@ -17,5 +17,6 @@ MapServer4|-9465|010700000001000|-9465
 MapServer4|-9460|010700000001000|-9460
 Removing the data table...
 Done.
+1869|POINT(1 2)
 BEGIN
 COMMIT