Issue 8457 - back-sql: unordered entries combined with pagination gives wrong results
Summary: back-sql: unordered entries combined with pagination gives wrong results
Status: VERIFIED SUSPENDED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: backends (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-28 16:11 UTC by matthias.hunstock@tu-ilmenau.de
Modified: 2021-04-01 16:27 UTC (History)
0 users

See Also:


Attachments
Patch for issue (686 bytes, patch)
2020-06-25 23:31 UTC, Quanah Gibson-Mount
Details

Note You need to log in before you can comment on or make changes to this issue.
Description matthias.hunstock@tu-ilmenau.de 2016-06-28 16:11:14 UTC
Full_Name: Matthias Hunstock
Version: git HEAD
OS: Linux
URL: ftp://ftp.openldap.org/incoming/fix-sql-order.patch
Submission from: (NULL) (2001:638:904:bf:e544:e758:826b:80ce)


Back-SQL does not use any "ORDER BY" statements when querying for ldap entries.
If a client uses pagination, there is code that that generates an optimized SQL
query with a WHERE clause like " AND ldap_entries.id > x " with x being the
highest id from the last paginated search result. As the DBMS gives results in
unsorted order, this leads to extremely reduced result sets because it is
randomly cut off. 

The linked patch resolves the issue for us.
Comment 1 Quanah Gibson-Mount 2017-03-22 16:59:19 UTC
moved from Incoming to Software Bugs
Comment 2 Quanah Gibson-Mount 2020-06-25 23:31:41 UTC
Created attachment 739 [details]
Patch for issue