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
When the database directory is removed while a DB is open, none of the DB operations raise any errors. The data seems to be stored correctly. But when the DB is opened again, the data is (obviously) gone. That kind of silent failure is confusing for the user.
Steps to reproduce:
fndelete_db_dir(){let path = PathBuf::from_str("./db").unwrap();let db = libmdbx::Database::<libmdbx::WriteMap>::open(&path).unwrap();
std::fs::remove_dir_all(&path);{let tx = db.begin_rw_txn().unwrap();let table = tx.open_table(None).unwrap();
tx.put(&table,"key","data",Default::default()).unwrap();
tx.commit().unwrap();}{let tx = db.begin_ro_txn().unwrap();let table = tx.open_table(None).unwrap();let data:Vec<u8> = tx.get(&table,"key".as_bytes()).unwrap().unwrap();}drop(db);let db = libmdbx::Database::<libmdbx::WriteMap>::open(&path).unwrap();{let tx = db.begin_ro_txn().unwrap();let table = tx.open_table(None).unwrap();let data:Vec<u8> = tx.get(&table,"key".as_bytes()).unwrap().unwrap();// panic: called `Option::unwrap()` on a `None` value}}
The text was updated successfully, but these errors were encountered:
When the database directory is removed while a DB is open, none of the DB operations raise any errors. The data seems to be stored correctly. But when the DB is opened again, the data is (obviously) gone. That kind of silent failure is confusing for the user.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: