[mapserver-commits] r13056 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Feb 6 12:42:13 EST 2012


Author: aboudreault
Date: 2012-02-06 09:42:13 -0800 (Mon, 06 Feb 2012)
New Revision: 13056

Modified:
   trunk/mapserver/mappostgis.c
Log:
During error report... do not show sql queries in msSetError, only in msDebug

Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c	2012-02-06 17:26:25 UTC (rev 13055)
+++ trunk/mapserver/mappostgis.c	2012-02-06 17:42:13 UTC (rev 13056)
@@ -2504,7 +2504,10 @@
 
     /* Something went wrong. */
     if (!pgresult || PQresultStatus(pgresult) != PGRES_TUPLES_OK) {
-        msSetError(MS_QUERYERR, "Error (%s) executing query: %s", "msPostGISLayerWhichShapes()", PQerrorMessage(layerinfo->pgconn), strSQL);
+        if ( layer->debug ) {
+	    msDebug("Error (%s) executing query: %s", "msPostGISLayerWhichShapes()\n", PQerrorMessage(layerinfo->pgconn), strSQL);
+	}
+        msSetError(MS_QUERYERR, "Error executing query: %s ", "msPostGISLayerWhichShapes()", PQerrorMessage(layerinfo->pgconn));
         free(strSQL);
         if (pgresult) {
             PQclear(pgresult);
@@ -2685,7 +2688,10 @@
 
         /* Something went wrong. */
         if ( (!pgresult) || (PQresultStatus(pgresult) != PGRES_TUPLES_OK) ) {
-            msSetError(MS_QUERYERR, "Error (%s) executing SQL: %s", "msPostGISLayerGetShape()", PQerrorMessage(layerinfo->pgconn), strSQL );
+	    if ( layer->debug ) {
+	        msDebug("Error (%s) executing SQL: %s", "msPostGISLayerGetShape()\n", PQerrorMessage(layerinfo->pgconn), strSQL );
+	    }            
+            msSetError(MS_QUERYERR, "Error executing SQL: %s", "msPostGISLayerGetShape()", PQerrorMessage(layerinfo->pgconn));
 
             if (pgresult) {
                 PQclear(pgresult);
@@ -2908,7 +2914,10 @@
     pgresult = PQexecParams(layerinfo->pgconn, sql,0, NULL, NULL, NULL, NULL, 0);
     
     if ( (!pgresult) || (PQresultStatus(pgresult) != PGRES_TUPLES_OK) ) {
-        msSetError(MS_QUERYERR, "Error (%s) executing SQL: %s", "msPostGISLayerGetItems()", PQerrorMessage(layerinfo->pgconn), sql);
+        if ( layer->debug ) {
+	  msDebug("Error (%s) executing SQL: %s", "msPostGISLayerGetItems()\n", PQerrorMessage(layerinfo->pgconn), sql);
+	}
+        msSetError(MS_QUERYERR, "Error executing SQL: %s", "msPostGISLayerGetItems()", PQerrorMessage(layerinfo->pgconn));
         if (pgresult) {
             PQclear(pgresult);
         }



More information about the mapserver-commits mailing list