Skip to content

Commit

Permalink
For data sources with inconsistent row numbers, queryByIndex should n…
Browse files Browse the repository at this point in the history
…ot set a resultindex. #4926 #4076
  • Loading branch information
mkofahl authored and tbonfort committed Sep 2, 2014
1 parent 6ae1e52 commit 500860a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mapquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,17 @@ int msQueryByIndex(mapObj *map)
return(MS_FAILURE);
}

/*
* The resultindex is used to retrieve a specific item from the result cache.
* Usually, the row number will be used as resultindex. But when working with
* databases and querying a single result, the row number is typically 0 and
* thus useless as the index in the result cache. See #4926 #4076. Only shape
* files are considered to have consistent row numbers.
*/
if ( !(lp->connectiontype == MS_SHAPEFILE || lp->connectiontype == MS_TILED_SHAPEFILE) ) {
shape.resultindex = -1;
}

if (lp->minfeaturesize > 0)
minfeaturesize = Pix2LayerGeoref(map, lp, lp->minfeaturesize);

Expand Down

0 comments on commit 500860a

Please sign in to comment.