core/mvcc: is_btree_allocated fix

This commit is contained in:
Pere Diaz Bou
2025-11-05 13:05:51 +01:00
parent 420447d6bd
commit 58f5b9c018
2 changed files with 2 additions and 6 deletions

View File

@@ -220,9 +220,9 @@ impl<Clock: LogicalClock + 'static> MvccLazyCursor<Clock> {
new_position
}
/// If page id is negative, it means the btree is not allocated.
fn is_btree_allocated(&self) -> bool {
self.table_id.is_btree_allocated()
let maybe_root_page = self.db.table_id_to_rootpage.get(&self.table_id);
maybe_root_page.is_some_and(|entry| entry.value().is_some())
}
}

View File

@@ -63,10 +63,6 @@ impl MVTableId {
assert!(value < 0, "MVCC table IDs are always negative");
Self(value)
}
pub fn is_btree_allocated(&self) -> bool {
self.0 >= 0
}
}
impl From<i64> for MVTableId {