]> granicus.if.org Git - postgis/commitdiff
Fix the 8.4 error only described in #1296.
authorBborie Park <bkpark at ucdavis.edu>
Thu, 17 Nov 2011 22:48:57 +0000 (22:48 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Thu, 17 Nov 2011 22:48:57 +0000 (22:48 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8165 b70326c6-7e19-0410-871a-916f4a2858ee

raster/test/regress/rt_mapalgebrafctngb.sql

index 75b620f30018bc7f45456ee80cf7e60aa29ee69b..97e30f57604842e45cab2aecae97076454da396d 100644 (file)
@@ -5,23 +5,25 @@ CREATE OR REPLACE FUNCTION ST_Sum(matrix float[][], nodatamode text, variadic ar
     RETURNS float AS
     $$
     DECLARE
+                               _matrix float[][];
         x1 integer;
         x2 integer;
         y1 integer;
         y2 integer;
         sum float;
     BEGIN
+                               _matrix := matrix;
         sum := 0;
         FOR x in array_lower(matrix, 1)..array_upper(matrix, 1) LOOP
             FOR y in array_lower(matrix, 2)..array_upper(matrix, 2) LOOP
-                IF matrix[x][y] IS NULL THEN
+                IF _matrix[x][y] IS NULL THEN
                     IF nodatamode = 'ignore' THEN
-                        matrix[x][y] := 0;
+                        _matrix[x][y] := 0;
                     ELSE
-                        matrix[x][y] := nodatamode::float;
+                        _matrix[x][y] := nodatamode::float;
                     END IF;
                 END IF;
-                sum := sum + matrix[x][y];
+                sum := sum + _matrix[x][y];
             END LOOP;
         END LOOP;
         RETURN sum;