mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-22 00:15:20 +01:00
Assert that skip_advance is not set in the middle of a seek
This commit is contained in:
@@ -3012,10 +3012,14 @@ pub fn seek_internal(
|
||||
|
||||
// this same logic applies for indexes, but the next/prev record is expected to be found in the parent page's
|
||||
// divider cell.
|
||||
turso_assert!(
|
||||
!cursor.skip_advance.get(),
|
||||
"skip_advance should not be true in the middle of a seek operation"
|
||||
);
|
||||
let result = match op {
|
||||
// deliberately call get_next_record() instead of next() to avoid skip_advance triggering unwantedly
|
||||
SeekOp::GT | SeekOp::GE { .. } => cursor.get_next_record()?,
|
||||
SeekOp::LT | SeekOp::LE { .. } => cursor.get_prev_record()?,
|
||||
SeekOp::GT | SeekOp::GE { .. } => cursor.next()?,
|
||||
SeekOp::LT | SeekOp::LE { .. } => cursor.prev()?,
|
||||
};
|
||||
match result {
|
||||
IOResult::Done(found) => {
|
||||
|
||||
Reference in New Issue
Block a user