Opened 10 years ago

Closed 10 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:


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 10 years ago by Even Rouault

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

comment:2 Changed 10 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.