[mapserver-commits] r13057 - branches/branch-6-0/mapserver

svn at osgeo.org svn at osgeo.org
Mon Feb 6 12:43:11 EST 2012


Author: aboudreault
Date: 2012-02-06 09:43:11 -0800 (Mon, 06 Feb 2012)
New Revision: 13057

Modified:
   branches/branch-6-0/mapserver/mappostgis.c
Log:
Backport 6.0: During error report... do not show sql queries in msSetError, only in msDebug

Modified: branches/branch-6-0/mapserver/mappostgis.c
===================================================================
--- branches/branch-6-0/mapserver/mappostgis.c	2012-02-06 17:42:13 UTC (rev 13056)
+++ branches/branch-6-0/mapserver/mappostgis.c	2012-02-06 17:43:11 UTC (rev 13057)
@@ -2468,7 +2468,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);
@@ -2649,7 +2652,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);
@@ -2872,7 +2878,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