[389-devel] Please review: [Bug 513916] Server doesn't ignore paged control, if page size and server's estimate of total no of entries are same

Noriko Hosoi nhosoi at redhat.com
Tue Aug 4 18:10:35 UTC 2009


https://bugzilla.redhat.com/show_bug.cgi?id=513916

*Bug 513916*  <https://bugzilla.redhat.com/show_bug.cgi?id=513916>  -Server doesn't ignore paged control, if page size and server's estimate of total no of entries are same

Description of problem: simple paged control which is equal to page size
returned is not returning to the shell prompt. Paged control prompt even though
there are no entries to be returned.

How reproducible: Consistently

Steps to Reproduce:
1. Add few entries to Directory server.
2. Write a simple paged search with page control which is equal to the no of
entries returned by server.
3. Observe the prompt.

For Eg: no of entries returned for the search is 6. Write a paged request as
below.
./ldapsearch.pl -x -pg 6 "cn=test*" "cn sn" -S "sn"


Actual results: Server doesn't ignore the paged control even the request can be
satisfied in a single page.


Expected results: Server should ignore the paged control if the page size is
equal to paged control.


[Files]
    ldap/servers/plugins/chainingdb/cb.h
    ldap/servers/plugins/chainingdb/cb_init.c
    ldap/servers/plugins/chainingdb/cb_search.c
    ldap/servers/slapd/back-ldbm/idl_common.c
    ldap/servers/slapd/back-ldbm/idl_new.c
    ldap/servers/slapd/back-ldbm/init.c
    ldap/servers/slapd/back-ldbm/ldbm_search.c
    ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
    ldap/servers/slapd/backend.c
    ldap/servers/slapd/backend_manager.c
    ldap/servers/slapd/dl.c
    ldap/servers/slapd/dse.c
    ldap/servers/slapd/opshared.c
    ldap/servers/slapd/pblock.c
    ldap/servers/slapd/proto-slap.h
    ldap/servers/slapd/slap.h
    ldap/servers/slapd/slapi-private.h

[Fix Description]
The code processing search results were returning the PAGE END without knowing
there are more entries to return or not.  To learn it, introduced "read ahead"
one entry when it comes to the PAGE END.  If there are more entries, the code
undo the read ahead, which prompts for the next page on the client side.
If there is no more entries, it returns the status SEARCH END instead of PAGE
END.

In addition to the read ahead implementation to fix the bug 513916,
* supporting Simple Paged Results for chaining backend is added.
* fixed a bug in idl_new_fetch (idl_new.c) -- idlistscanlimit was not checked
   when the cursor comes to the end of an index file.

[Proposed Fix]
Created an attachment (id=356215)
  -->  (https://bugzilla.redhat.com/attachment.cgi?id=356215)
git patch file

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/389-devel/attachments/20090804/6386fb2c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3250 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/389-devel/attachments/20090804/6386fb2c/attachment.bin 


More information about the 389-devel mailing list