Ticket #392: modifiedpostlistdeletes.patch
File modifiedpostlistdeletes.patch, 2.4 KB (added by , 15 years ago) |
---|
-
xapian-core/tests/api_wrdb.cc
1958 1958 1959 1959 return true; 1960 1960 } 1961 1962 /** Regression test for bug in ModifiedPostList iteration 1963 */ 1964 DEFINE_TESTCASE(modifiedpostlist1, writable) { 1965 Xapian::WritableDatabase db = get_writable_database(); 1966 Xapian::Document a, b; 1967 Xapian::Enquire enq(db); 1968 1969 a.add_term("T"); 1970 enq.set_query(Xapian::Query("T")); 1971 1972 db.replace_document(2, a); 1973 db.commit(); 1974 db.replace_document(1, a); 1975 db.replace_document(1, b); 1976 1977 mset_expect_order(enq.get_mset(0, 2), 2); 1978 1979 return true; 1980 } -
xapian-core/backends/chert/chert_modifiedpostlist.cc
32 32 ChertModifiedPostList::skip_deletes(Xapian::weight w_min) 33 33 { 34 34 while (!ChertPostList::at_end()) { 35 while (it != mods.end() && it->second.first == 'D' && it->first < ChertPostList::get_docid()) ++it; 35 36 if (it == mods.end()) return; 36 37 if (it->first != ChertPostList::get_docid()) return; 37 38 if (it->second.first != 'D') return; … … 52 53 { 53 54 if (it == mods.end()) return ChertPostList::get_docid(); 54 55 if (ChertPostList::at_end()) return it->first; 56 Assert(it->second.first != 'D'); 55 57 return min(it->first, ChertPostList::get_docid()); 56 58 } 57 59 -
xapian-core/backends/flint/flint_modifiedpostlist.cc
32 32 FlintModifiedPostList::skip_deletes(Xapian::weight w_min) 33 33 { 34 34 while (!FlintPostList::at_end()) { 35 while (it != mods.end() && it->second.first == 'D' && it->first < FlintPostList::get_docid()) ++it; 35 36 if (it == mods.end()) return; 36 37 if (it->first != FlintPostList::get_docid()) return; 37 38 if (it->second.first != 'D') return; … … 52 53 { 53 54 if (it == mods.end()) return FlintPostList::get_docid(); 54 55 if (FlintPostList::at_end()) return it->first; 56 Assert(it->second.first != 'D'); 55 57 return min(it->first, FlintPostList::get_docid()); 56 58 } 57 59