allocate the iteminfo index array - same order as the item list */
| 471 | |
| 472 | /* allocate the iteminfo index array - same order as the item list */ |
| 473 | int msMSSQL2008LayerInitItemInfo(layerObj *layer) |
| 474 | { |
| 475 | int i; |
| 476 | int *itemindexes ; |
| 477 | |
| 478 | if (layer->debug) { |
| 479 | msDebug("msMSSQL2008LayerInitItemInfo called\n"); |
| 480 | } |
| 481 | |
| 482 | if(layer->numitems == 0) { |
| 483 | return MS_SUCCESS; |
| 484 | } |
| 485 | |
| 486 | msFree(layer->iteminfo); |
| 487 | |
| 488 | layer->iteminfo = (int *) msSmallMalloc(sizeof(int) * layer->numitems); |
| 489 | |
| 490 | itemindexes = (int*)layer->iteminfo; |
| 491 | |
| 492 | for(i = 0; i < layer->numitems; i++) { |
| 493 | itemindexes[i] = i; /* last one is always the geometry one - the rest are non-geom */ |
| 494 | } |
| 495 | |
| 496 | return MS_SUCCESS; |
| 497 | } |
| 498 | |
| 499 | /* Prepare and execute the SQL statement for this layer */ |
| 500 | static int prepare_database(layerObj *layer, rectObj rect, char **query_string) |
no test coverage detected