Commit 5f37e1f0 authored by Bborie Park's avatar Bborie Park

escape delimiter of ST_Band(). Ticket #2812

git-svn-id: http://svn.osgeo.org/postgis/trunk@12741 b70326c6-7e19-0410-871a-916f4a2858ee
parent 6dc54f2e
......@@ -411,7 +411,7 @@ CREATE OR REPLACE FUNCTION st_band(rast raster, nband int)
CREATE OR REPLACE FUNCTION st_band(rast raster, nbands text, delimiter char DEFAULT ',')
RETURNS RASTER
AS $$ SELECT st_band($1, regexp_split_to_array(regexp_replace($2, '[[:space:]]', '', 'g'), $3)::int[]) $$
AS $$ SELECT st_band($1, regexp_split_to_array(regexp_replace($2, '[[:space:]]', '', 'g'), '\' || array_to_string(regexp_split_to_array($3, ''), '\'))::int[]) $$
LANGUAGE 'sql' IMMUTABLE STRICT;
-----------------------------------------------------------------------
......
......@@ -316,3 +316,35 @@ SELECT ST_NumBands(
)
, ARRAY[999])
);
-- Ticket #2812
SELECT ST_Value(
ST_Band(
ST_AddBand(
ST_AddBand(
ST_AddBand(
ST_MakeEmptyRaster(200, 200, 10, 10, 2, 2, 0, 0,0)
, 1, '64BF', 1234.5678, NULL
)
, '64BF', 987.654321, NULL
)
, '64BF', 9876.54321, NULL
),
'1|1', '|'
),
2, 3, 3);
SELECT ST_Value(
ST_Band(
ST_AddBand(
ST_AddBand(
ST_AddBand(
ST_MakeEmptyRaster(200, 200, 10, 10, 2, 2, 0, 0,0)
, 1, '64BF', 1234.5678, NULL
)
, '64BF', 987.654321, NULL
)
, '64BF', 9876.54321, NULL
),
'1.*.2', '.*.'
),
2, 3, 3);
......@@ -25,3 +25,5 @@ NOTICE: Invalid band index (must use 1-based). Returning original raster
3
NOTICE: Invalid band index (must use 1-based). Returning original raster
3
1234.5678
987.654321
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment