Sorted ZCatalog results report incorrect actual_result_count

Bug #1237141 reported by Alec Mitchell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Unassigned

Bug Description

When some results in a search result set do not have a value set for the sort index, those results are excluded by the sortResults() method in Catalog.py. This is a longstanding behavior, and isn't entirely unreasonable. However, the result count attached to the final results (actual_result_count) is not adjusted for the excluded results, so the length of the sequence may be shorter than its reported "actual" length. See:

https://github.com/zopefoundation/Products.ZCatalog/blob/2.13/src/Products/ZCatalog/Catalog.py#L769

The simplest solution would be to decrement the actual_result_count variable in that except block, but I'm not sure if doing so would be entirely safe or cover all cases where this issue might arise. There are a number of code paths based on different optimization strategies here.

Revision history for this message
Hanno Schlichting (hannosch) wrote :
Changed in zope2:
status: New → Fix Committed
Revision history for this message
Hanno Schlichting (hannosch) wrote :

Fix released in 2.13.26.

Changed in zope2:
milestone: none → 2.13.22
status: Fix Committed → Fix Released
Revision history for this message
Alec Mitchell (alecm) wrote :

Thanks Hanno!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.