[Geoserver-devel] [jira] (GEOS-5085) WFS 2.0 paging returns wrong features for startindex=0

Ben Caradoc-Davies created GEOS-5085:
----------------------------------------

             Summary: WFS 2.0 paging returns wrong features for startindex=0
                 Key: GEOS-5085
                 URL: https://jira.codehaus.org/browse/GEOS-5085
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
    Affects Versions: 2.2.x
         Environment: postgresql-9.1_9.1.3-2_i386.deb

GeoServer:
Version 2.2-SNAPSHOT
Subversion Revision 16812
Build Date 11-Mar-2012 19:23
GeoTools Version 8-SNAPSHOT (rev 38626)
            Reporter: Ben Caradoc-Davies
            Assignee: Justin Deoliveira
            Priority: Critical

Looks like WFS 2.0 startindex=0 does not trigger the sorting used to implement paging, causing the first page of results to be inconsistent with subsequent pages, resulting in duplicate features in the data set.

I have some simple features (numberMatched="1354965") from a source postgis table with an integer primary key starting at 1. If I ask for the first page (startindex=0), I get some random features. If I ask for subsequent pages, they appear as if the first count were the features with primary key 1..count.

For example, if I set count=1:

count=1&startindex=0
Response has: gml:id="lith_samples.808129"

count=1&startindex=1
Response has: gml:id="lith_samples.2"

count=1&startindex=2
Response has: gml:id="lith_samples.3"

and

count=1&startindex=808128
Response has: gml:id=""lith_samples.808129"

Duplicate feature!

I suspect that there is a logic error for startindex=0. How does the implementation distinguish between startindex=0 and no startindex supplied?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira