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

svn at osgeo.org svn at osgeo.org
Sat May 28 06:33:11 EDT 2011


Author: tamas
Date: 2011-05-28 03:33:11 -0700 (Sat, 28 May 2011)
New Revision: 11764

Modified:
   branches/branch-5-6/mapserver/mapmssql2008.c
Log:
revert previous changes (#3894)

Modified: branches/branch-5-6/mapserver/mapmssql2008.c
===================================================================
--- branches/branch-5-6/mapserver/mapmssql2008.c	2011-05-28 10:26:21 UTC (rev 11763)
+++ branches/branch-5-6/mapserver/mapmssql2008.c	2011-05-28 10:33:11 UTC (rev 11764)
@@ -75,7 +75,6 @@
 
 #define SQL_COLUMN_NAME_MAX_LENGTH 128
 #define SQL_TABLE_NAME_MAX_LENGTH 128
-#define SQL_OID_SIZE 20
 
 #define DATA_ERROR_MESSAGE \
     "%s" \
@@ -574,7 +573,7 @@
     {
         char buffer[1000];
 
-        snprintf(buffer, sizeof(buffer), "%s.STAsBinary(),convert(varchar(%d), %s)", layerinfo->geom_column, SQL_OID_SIZE, layerinfo->urid_name);
+        snprintf(buffer, sizeof(buffer), "%s.STAsBinary(),convert(varchar(36), %s)", layerinfo->geom_column, layerinfo->urid_name);
 
         columns_wanted = _strdup(buffer);
     } 
@@ -586,7 +585,7 @@
             snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "convert(varchar(max), %s),", layer->items[t]);
         }
 
-        snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "%s.STAsBinary(),convert(varchar(%d), %s)", layerinfo->geom_column, SQL_OID_SIZE, layerinfo->urid_name);
+        snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "%s.STAsBinary(),convert(varchar(36), %s)", layerinfo->geom_column, layerinfo->urid_name);
 
         columns_wanted = _strdup(buffer);
     }
@@ -1247,7 +1246,7 @@
 	char dummyBuffer[1];
 	char *wkbBuffer;
 	char *valueBuffer;
-	char oidBuffer[ SQL_OID_SIZE + 1 ];
+	char oidBuffer[ 16 ];		/* assuming the OID will always be a long this should be enough */
     long record_oid;
 	int t;
 
@@ -1387,7 +1386,6 @@
 
                     case MS_LAYER_ANNOTATION:
                     case MS_LAYER_QUERY:
-                    case MS_LAYER_CHART:
                         result = dont_force(wkbBuffer, shape);
                         break;
 
@@ -1487,7 +1485,7 @@
 
     if(layer->numitems == 0) 
     {
-        snprintf(buffer, sizeof(buffer), "%s.STAsBinary(), convert(varchar(%d), %s)", layerinfo->geom_column, SQL_OID_SIZE, layerinfo->urid_name);
+        snprintf(buffer, sizeof(buffer), "%s.STAsBinary(), convert(varchar(36), %s)", layerinfo->geom_column, layerinfo->urid_name);
         columns_wanted = _strdup(buffer);
     } 
     else 
@@ -1496,7 +1494,7 @@
             snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "convert(varchar(max), %s),", layer->items[t]);
         }
 
-        snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "%s.STAsBinary(), convert(varchar(%d), %s)", layerinfo->geom_column, SQL_OID_SIZE, layerinfo->urid_name);
+        snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "%s.STAsBinary(), convert(varchar(36), %s)", layerinfo->geom_column, layerinfo->urid_name);
 
         columns_wanted = _strdup(buffer);
     }



More information about the mapserver-commits mailing list