[mapserver-commits] r10943 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Feb 5 11:13:46 EST 2011
Author: tamas
Date: 2011-02-05 08:13:46 -0800 (Sat, 05 Feb 2011)
New Revision: 10943
Modified:
trunk/mapserver/mapmssql2008.c
Log:
Modify mapmssql2008.c according to the changes in the query handling (#3647)
Modified: trunk/mapserver/mapmssql2008.c
===================================================================
--- trunk/mapserver/mapmssql2008.c 2011-02-05 15:42:36 UTC (rev 10942)
+++ trunk/mapserver/mapmssql2008.c 2011-02-05 16:13:46 UTC (rev 10943)
@@ -1470,18 +1470,19 @@
return result;
}
-/* Execute a query on the DB based on record being an primary key. */
-int msMSSQL2008LayerGetShape(layerObj *layer, shapeObj *shape, long record)
+/* Execute a query on the DB based on the query result. */
+int msMSSQL2008LayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record)
{
char *query_str;
char *columns_wanted = 0;
-
+
msMSSQL2008LayerInfo *layerinfo;
int t;
char buffer[32000] = "";
+ long shapeindex = record->shapeindex;
if(layer->debug) {
- msDebug("msMSSQL2008LayerGetShape called for record = %i\n", record);
+ msDebug("msMSSQL2008LayerGetShape called for shapeindex = %i\n", shapeindex);
}
layerinfo = getMSSQL2008LayerInfo(layer);
@@ -1510,7 +1511,7 @@
}
/* index_name is ignored here since the hint should be for the spatial index, not the PK index */
- snprintf(buffer, sizeof(buffer), "select %s from %s where %s = %d", columns_wanted, layerinfo->geom_table, layerinfo->urid_name, record);
+ snprintf(buffer, sizeof(buffer), "select %s from %s where %s = %d", columns_wanted, layerinfo->geom_table, layerinfo->urid_name, shapeindex);
query_str = msStrdup(buffer);
@@ -1929,12 +1930,6 @@
/* end above's #ifdef USE_MSSQL2008 */
#endif
-int
-msMSSQL2008LayerGetShapeVT(layerObj *layer, shapeObj *shape, int tile, long record)
-{
- return msMSSQL2008LayerGetShape(layer, shape, record);
-}
-
#ifdef USE_MSSQL2008_PLUGIN
MS_DLL_EXPORT int
@@ -1949,8 +1944,7 @@
vtable->LayerIsOpen = msMSSQL2008LayerIsOpen;
vtable->LayerWhichShapes = msMSSQL2008LayerWhichShapes;
vtable->LayerNextShape = msMSSQL2008LayerNextShape;
- vtable->LayerGetShape = msMSSQL2008LayerGetShapeVT;
- vtable->LayerResultsGetShape = msMSSQL2008LayerGetShapeVT; /* no special version, use ...GetShape() */
+ vtable->LayerGetShape = msMSSQL2008LayerGetShape;
vtable->LayerClose = msMSSQL2008LayerClose;
@@ -1984,8 +1978,7 @@
layer->vtable->LayerIsOpen = msMSSQL2008LayerIsOpen;
layer->vtable->LayerWhichShapes = msMSSQL2008LayerWhichShapes;
layer->vtable->LayerNextShape = msMSSQL2008LayerNextShape;
- layer->vtable->LayerGetShape = msMSSQL2008LayerGetShapeVT;
- layer->vtable->LayerResultsGetShape = msMSSQL2008LayerGetShapeVT; /* no special version, use ...GetShape() */
+ layer->vtable->LayerGetShape = msMSSQL2008LayerGetShape;
layer->vtable->LayerClose = msMSSQL2008LayerClose;
More information about the mapserver-commits
mailing list