mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-03 17:48:17 +00:00
assert new divider cell points to the correct place
This commit is contained in:
parent
15ed7642c9
commit
f4920cb96b
1 changed files with 9 additions and 0 deletions
|
@ -1833,6 +1833,15 @@ impl BTreeCursor {
|
|||
// Leaf index
|
||||
new_divider_cell.extend_from_slice(divider_cell);
|
||||
}
|
||||
|
||||
let left_pointer = read_u32(&new_divider_cell[..4], 0);
|
||||
assert_eq!(left_pointer, page.get().id as u32);
|
||||
// FIXME: remove this lock
|
||||
assert!(
|
||||
left_pointer <= self.pager.db_header.lock().database_size,
|
||||
"invalid page number divider left pointer {} > database number of pages",
|
||||
left_pointer,
|
||||
);
|
||||
// FIXME: defragment shouldn't be needed
|
||||
defragment_page(parent_contents, self.usable_space() as u16);
|
||||
insert_into_cell(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue