Opened 14 years ago

Closed 14 years ago

#450 closed defect (fixed)

wdf_upper_bound is not always correct on WritableDatabase

Reported by: Richard Boulton Owned by: Olly Betts
Priority: normal Milestone: 1.1.5
Component: Backend-Chert Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

If get_wdf_upper_bound() is called on a WritableDatabase when unflush modifications have been made to a term, an incorrect bound can be returned.

For example, I will attach a patch to tests/dbcheck.cc which makes it check the consistency of bounds. If the patch is applied to SVN trunk, various testcases will fail: for example, modtermwdf1 will fail at line 135 with the error:

/home/richard/private/Working/xapian/trunk/xapian-core/tests/dbcheck.cc:276: (wdf_upper_bound) <= (db.get_wdf_upper_bound(*t))
Evaluates to: 2 <= 0

Adding further debugging shows that this is testing the bound for the term "takeaway", for which the posting list contains one entry with wdf 2, so db.get_wdf_upper_bound(*t) should be returning at least 2.

Attachments (1)

dbcheck.patch (3.7 KB ) - added by Richard Boulton 14 years ago.
Patch to dbcheck to check integrity of bounds

Download all attachments as: .zip

Change History (2)

by Richard Boulton, 14 years ago

Attachment: dbcheck.patch added

Patch to dbcheck to check integrity of bounds

comment:1 by Richard Boulton, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in r14048, with test coverage added in r14049.

Note: See TracTickets for help on using tickets.