mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
btree: fix not setting cell_index properly after a failed EQ seek
This commit is contained in:
parent
b3091b1ca3
commit
f77c95730d
1 changed files with 12 additions and 1 deletions
|
@ -1894,7 +1894,18 @@ impl BTreeCursor {
|
|||
// - We have seen an EQ match up in the tree in an interior node
|
||||
// - Or, we are not looking for an exact match.
|
||||
if seek_op.eq_only() && !eq_seen.get() {
|
||||
return Ok(CursorResult::Ok(false));
|
||||
match iter_dir {
|
||||
IterationDirection::Forwards => {
|
||||
// Set cell index beyond the last cell, so that the state looks like we scanned the entire page and found no match.
|
||||
self.stack.set_cell_index(cell_count as i32);
|
||||
return Ok(CursorResult::Ok(false));
|
||||
}
|
||||
IterationDirection::Backwards => {
|
||||
// Set cell index to -1, so that the state looks like we scanned the entire page backwards and found no match.
|
||||
self.stack.set_cell_index(-1);
|
||||
return Ok(CursorResult::Ok(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
match iter_dir {
|
||||
IterationDirection::Forwards => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue