You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following test, the presence or abscence of the db.process_commits call changes the iteration behavior of the last iter.prev() call.
If db.process_commit is never called, the last iter.prev() returns the key [0] as exepected, if db.process_commit is called before iterating, it returns None.
This test is doing both forward and backward iterations, I don't know if we want to support both on the same iterator...
#[cfg(feature = "instrumentation")]#[test]fntest_process_commit_in_the_middle_of_iter(){let tmp = tempdir().unwrap();letmut options = Options::with_columns(tmp.path(),1);
options.columns[0].btree_index = true;
options.always_flush = true;
options.with_background_thread = false;let db = Db::open_or_create(&options).unwrap();
db.commit::<_,Vec<u8>>(vec![(0, vec![0],Some(vec![0]))]).unwrap();
db.process_commits().unwrap();letmut iter = db.iter(0).unwrap();
iter.seek_to_last().unwrap();assert_eq!(iter.prev().unwrap(),Some((vec![0], vec![0])));// State = 0assert_eq!(iter.next().unwrap(),None);// State = Endassert_eq!(iter.prev().unwrap(),Some((vec![0], vec![0])));// Fails because is None, work properly if process_commit is not called}
Changelog: 2022-10-24: Updated the bug description, the bug happens even if process_commits is called before iterating.
The text was updated successfully, but these errors were encountered:
In the following test, the presence or abscence of the
db.process_commits
call changes the iteration behavior of the lastiter.prev()
call.If
db.process_commit
is never called, the lastiter.prev()
returns the key[0]
as exepected, ifdb.process_commit
is called before iterating, it returnsNone
.This test is doing both forward and backward iterations, I don't know if we want to support both on the same iterator...
Changelog: 2022-10-24: Updated the bug description, the bug happens even if
process_commits
is called before iterating.The text was updated successfully, but these errors were encountered: