mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-22 01:24:18 +01:00
core/mvcc: is_btree_allocated fix
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user