[mapserver-commits] r10081 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Apr 8 15:47:37 EDT 2010


Author: pramsey
Date: 2010-04-08 15:47:36 -0400 (Thu, 08 Apr 2010)
New Revision: 10081

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mappostgis.c
Log:
Generate good SQL when using !BOX! and no filter. (#3422)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-04-08 17:43:49 UTC (rev 10080)
+++ trunk/mapserver/HISTORY.TXT	2010-04-08 19:47:36 UTC (rev 10081)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Generate good SQL when using !BOX! token and no filter. (#3422)
+
 - Implement non-shapefile tileindex support for raster query (#2796).
 
 - Improve support for [red/green/blue] classification expressions for

Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c	2010-04-08 17:43:49 UTC (rev 10080)
+++ trunk/mapserver/mappostgis.c	2010-04-08 19:47:36 UTC (rev 10081)
@@ -1336,7 +1336,9 @@
     char *strItems = 0;
     char *strWhere = 0;
     char *strSQL = 0;
-    static char *strSQLTemplate = "select %s from %s where %s";
+    static char *strSQLTemplate0 = "select %s from %s where %s";
+    static char *strSQLTemplate1 = "select %s from %s%s";
+    char *strSQLTemplate = 0;
 
     if (layer->debug) {
         msDebug("msPostGISBuildSQL called.\n");
@@ -1372,6 +1374,8 @@
         return 0;
     }
 
+    strSQLTemplate = strlen(strWhere) ? strSQLTemplate0 : strSQLTemplate1;
+
     strSQL = malloc(strlen(strSQLTemplate) + strlen(strFrom) + strlen(strItems) + strlen(strWhere));
     sprintf(strSQL, strSQLTemplate, strItems, strFrom, strWhere);
     if (strItems) free(strItems);



More information about the mapserver-commits mailing list