diff --git a/core/mvcc/cursor.rs b/core/mvcc/cursor.rs index e024d454f..124b0ca49 100644 --- a/core/mvcc/cursor.rs +++ b/core/mvcc/cursor.rs @@ -220,9 +220,9 @@ impl MvccLazyCursor { 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()) } } diff --git a/core/mvcc/database/mod.rs b/core/mvcc/database/mod.rs index c249811b0..0057e56d8 100644 --- a/core/mvcc/database/mod.rs +++ b/core/mvcc/database/mod.rs @@ -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 for MVTableId {