Opened 9 years ago

Closed 9 years ago

#4419 closed defect (fixed)

OGR SQL: ORDER BY doesn't work properly if GetFeatureCount() < number of features

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.9.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

OGRGenSQLResultsLayer::CreateOrderByIndex?() which is used to process ORDER BY clauses assumes that GetFeatureCount?() return exactly the number of features returned by iterating over features with GetNextFeature?(). But for a shapefile with deleted records, GetFeatureCount?() will over-estimate the number of features. Which in debug mode leads to an assertion, and in release mode leads to potentially garbage or segfaults.

Change History (2)

comment:1 Changed 9 years ago by Even Rouault

Fixed in trunk (r23682) and in branches/1.9 (r23683)

comment:2 Changed 9 years ago by Even Rouault

Milestone: 1.9.0
Resolution: fixed
Status: newclosed

Pushed in time for RC2.

Note: See TracTickets for help on using tickets.