From dad1e6293b24d45e4b2515ba02202450d0f545cf Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Wed, 28 May 2025 16:45:40 +0300 Subject: [PATCH] Btree: fix cursor record state not being updated in insert_into_page() overwrite_cell() requires that the cursor state is pointing to a valid record, but this was not currently set properly. --- core/storage/btree.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/storage/btree.rs b/core/storage/btree.rs index 735f0495e..71fffe0c7 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -2153,6 +2153,7 @@ impl BTreeCursor { ) == Ordering::Equal { tracing::debug!("insert_into_page: found exact match with cell_idx={cell_idx}, overwriting"); + self.has_record.set(CursorHasRecord::Yes { rowid: self.get_index_rowid_from_record() }); self.overwrite_cell(page.clone(), cell_idx, record)?; self.state .mut_write_info()