#18 closed defect (released)
get_mset with first!=0 unusable
Reported by: | Olivier Galibert | Owned by: | Olly Betts |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Library API | Version: | 0.7.2 |
Severity: | major | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | Linux |
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 (3)
comment:1 by , 21 years ago
Status: | new → assigned |
---|
comment:2 by , 21 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 21 years ago
Operating System: | → Linux |
---|---|
Resolution: | fixed → released |
Fixed in CVS (with regression test msetiterator3). Thanks for the patch!