diff --git a/xapian-core/backends/glass/glass_postlist.cc b/xapian-core/backends/glass/glass_postlist.cc
index a7f6fa535ee6..774521fd179b 100644
|
a
|
b
|
GlassPostList::GlassPostList(intrusive_ptr<const GlassDatabase> this_db_,
|
| 701 | 701 | this_db(keep_reference ? this_db_ : nullptr), |
| 702 | 702 | have_started(false), |
| 703 | 703 | is_at_end(false), |
| | 704 | all_docs(term_.empty()), |
| 704 | 705 | cursor(this_db_->postlist_table.cursor_get()) |
| 705 | 706 | { |
| 706 | 707 | LOGCALL_CTOR(DB, "GlassPostList", this_db_.get() | term_ | keep_reference); |
| … |
… |
GlassPostList::GlassPostList(intrusive_ptr<const GlassDatabase> this_db_,
|
| 714 | 715 | this_db(this_db_), |
| 715 | 716 | have_started(false), |
| 716 | 717 | is_at_end(false), |
| | 718 | all_docs(term_.empty()), |
| 717 | 719 | cursor(cursor_) |
| 718 | 720 | { |
| 719 | 721 | LOGCALL_CTOR(DB, "GlassPostList", this_db_.get() | term_ | cursor_); |
| … |
… |
GlassPostList::next_chunk()
|
| 814 | 816 | const char * keypos = cursor->current_key.data(); |
| 815 | 817 | const char * keyend = keypos + cursor->current_key.size(); |
| 816 | 818 | // Check we're still in same postlist |
| 817 | | if (!check_term_in_key_lite(&keypos, keyend, term)) { |
| | 819 | string_view kterm = all_docs ? string_view() : term; |
| | 820 | if (!check_term_in_key_lite(&keypos, keyend, kterm)) { |
| 818 | 821 | is_at_end = true; |
| 819 | 822 | throw Xapian::DatabaseCorruptError("Unexpected end of posting list for '" + |
| 820 | 823 | term + "'"); |
| … |
… |
void
|
| 900 | 903 | GlassPostList::move_to_chunk_containing(Xapian::docid desired_did) |
| 901 | 904 | { |
| 902 | 905 | LOGCALL_VOID(DB, "GlassPostList::move_to_chunk_containing", desired_did); |
| 903 | | (void)cursor->find_entry(GlassPostListTable::make_key(term, desired_did)); |
| | 906 | string_view kterm = all_docs ? string_view() : term; |
| | 907 | (void)cursor->find_entry(GlassPostListTable::make_key(kterm, desired_did)); |
| 904 | 908 | Assert(!cursor->after_end()); |
| 905 | 909 | |
| 906 | 910 | const char * keypos = cursor->current_key.data(); |
| 907 | 911 | const char * keyend = keypos + cursor->current_key.size(); |
| 908 | 912 | // Check we're still in same postlist |
| 909 | | if (!check_term_in_key_lite(&keypos, keyend, term)) { |
| | 913 | if (!check_term_in_key_lite(&keypos, keyend, kterm)) { |
| 910 | 914 | // This should only happen if the postlist doesn't exist at all. |
| 911 | 915 | is_at_end = true; |
| 912 | 916 | is_last_chunk = true; |
diff --git a/xapian-core/backends/glass/glass_postlist.h b/xapian-core/backends/glass/glass_postlist.h
index 2fef145b5266..68f852ba9702 100644
|
a
|
b
|
class GlassPostList : public LeafPostList {
|
| 69 | 69 | /// Whether we've run off the end of the list yet. |
| 70 | 70 | bool is_at_end; |
| 71 | 71 | |
| | 72 | /** Are we iterating all docs? |
| | 73 | * |
| | 74 | * This is true for the GlassPostList for the doc lengths. |
| | 75 | * |
| | 76 | * We also use it for a term which indexes all the documents if we don't |
| | 77 | * need wdfs. We call set_term() so can't just use the term name to |
| | 78 | * build keys, etc after construction. |
| | 79 | */ |
| | 80 | bool all_docs = false; |
| | 81 | |
| 72 | 82 | /// Cursor pointing to current chunk of postlist. |
| 73 | 83 | std::unique_ptr<GlassCursor> cursor; |
| 74 | 84 | |