[mapserver-commits] r10102 - branches/branch-5-6/mapserver

svn at osgeo.org svn at osgeo.org
Tue Apr 13 10:08:12 EDT 2010


Author: assefa
Date: 2010-04-13 10:08:11 -0400 (Tue, 13 Apr 2010)
New Revision: 10102

Modified:
   branches/branch-5-6/mapserver/HISTORY.TXT
   branches/branch-5-6/mapserver/mapogcfilter.c
Log:
OGC Filters for spatial dbs should be enclosed in parentheses (#3430)

Modified: branches/branch-5-6/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-6/mapserver/HISTORY.TXT	2010-04-13 02:59:44 UTC (rev 10101)
+++ branches/branch-5-6/mapserver/HISTORY.TXT	2010-04-13 14:08:11 UTC (rev 10102)
@@ -15,6 +15,8 @@
 Version 5.6.4 (????-??-??):
 ---------------------------
  
+- OGC Filters for spatial dbs should be enclosed in parentheses (#3430)
+
 - Improve the handling of simple string comparisons for raster classified
   values (#3425) 
 

Modified: branches/branch-5-6/mapserver/mapogcfilter.c
===================================================================
--- branches/branch-5-6/mapserver/mapogcfilter.c	2010-04-13 02:59:44 UTC (rev 10101)
+++ branches/branch-5-6/mapserver/mapogcfilter.c	2010-04-13 14:08:11 UTC (rev 10102)
@@ -975,6 +975,7 @@
     int bConcatWhere = 0;
     int bHasAWhere =0;
     char *pszFilterItem=NULL;
+    char *pszTmp = NULL;
 
     lp = (GET_LAYER(map, iLayerIndex));
 
@@ -1044,7 +1045,17 @@
     bHasAWhere = 0;
     if (lp->connectiontype == MS_POSTGIS || lp->connectiontype ==  MS_ORACLESPATIAL ||
         lp->connectiontype == MS_SDE || lp->connectiontype == MS_PLUGIN)
-      szExpression = FLTGetSQLExpression(psNode, lp);
+    {
+        szExpression = FLTGetSQLExpression(psNode, lp);
+        if (szExpression)
+        {
+            pszTmp = strdup("(");
+            pszTmp = msStringConcatenate(pszTmp, szExpression);
+            pszTmp = msStringConcatenate(pszTmp, ")");
+            msFree(szExpression);
+            szExpression = pszTmp;
+        }
+    }
     /* concatenates the WHERE clause for OGR layers. This only applies if
        the expression was empty or not of an expression string. If there
        is an sql type expression, it is assumed to have the WHERE clause. 



More information about the mapserver-commits mailing list