[mapserver-commits] r9930 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Mar 10 09:48:24 EST 2010


Author: assefa
Date: 2010-03-10 09:48:22 -0500 (Wed, 10 Mar 2010)
New Revision: 9930

Modified:
   trunk/mapserver/mapogcfilter.c
Log:
Add quote around attribute names for postgis layers #3311

Modified: trunk/mapserver/mapogcfilter.c
===================================================================
--- trunk/mapserver/mapogcfilter.c	2010-03-10 05:23:36 UTC (rev 9929)
+++ trunk/mapserver/mapogcfilter.c	2010-03-10 14:48:22 UTC (rev 9930)
@@ -3221,7 +3221,12 @@
       
 
     /*opening bracket*/
-    strcat(szBuffer, " (");
+    /*for postgis layers double quote the attribute name, allowing reserved names to
+ *       be used as attribute name #3311*/
+    if (lp->connectiontype == MS_POSTGIS)
+      strcat(szBuffer, " (\"");
+    else
+      strcat(szBuffer, " (");
 
     /* attribute */
     /*case insensitive set ? */
@@ -3237,8 +3242,10 @@
     else
       strcat(szBuffer, psFilterNode->psLeftNode->pszValue);
 
-    
+    if (lp->connectiontype == MS_POSTGIS)
+     strcat(szBuffer, "\"");
 
+
     /* logical operator */
     if (strcasecmp(psFilterNode->pszValue, 
                    "PropertyIsEqualTo") == 0)



More information about the mapserver-commits mailing list