Ticket #18 (closed defect: released)

Opened 5 years ago

Last modified 5 years ago

get_mset with first!=0 unusable

Reported by: galibert Owned by: olly
Priority: high Milestone:
Component: Library API Version: 0.7.2
Severity: major Keywords:
Cc: Blocked By:
Operating System: Linux Blocking:

Description

If you do a get_mset on an enquire with first != 0 and then try to get the first document through begin()->get_document(), the api blows with: The mset returned from the match does not contain the document at index 0 The reason is that the iterator index is 0..size-1, but MSet::Internal::get_doc_by_index(index) expects index to be in the range firstiterm..firstitem+size-1. Simple fix putting get_doc_by_index assumptions in check with the others: --- omenquire.cc~ 2003-06-05 02:36:10.000000000 +0200 +++ omenquire.cc 2003-08-05 16:59:25.000000000 +0200 @@ -411,6 +411,7 @@

{

DEBUGCALL(API, Document,

"Xapian::MSet::Internal::Data::get_doc_by_index",

index);

+ index += firstitem;

map<Xapian::doccount, Document>::const_iterator doc; doc = indexeddocs.find(index); if (doc != indexeddocs.end()) {

Change History

Changed 5 years ago by olly

  • status changed from new to assigned

Changed 5 years ago by olly

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in CVS (with regression test msetiterator3). Thanks for the patch!

Changed 5 years ago by olly

  • resolution changed from fixed to released

Changed 5 years ago by trac

  • platform set to Linux
Note: See TracTickets for help on using tickets.