We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code panics with thread 'main' panicked at 'attempt to subtract with overflow', .../jammdb-0.5.0/src/page.rs:107:25:
thread 'main' panicked at 'attempt to subtract with overflow', .../jammdb-0.5.0/src/page.rs:107:25
const TEST_DB: &str = "tmp.db"; fn main() { let _ = std::fs::remove_file(TEST_DB); { let db = jammdb::DB::open(TEST_DB).unwrap(); { let tx = db.tx(true).unwrap(); let root = tx.get_or_create_bucket("ROOT").unwrap(); tx.commit().unwrap(); } { let tx = db.tx(true).unwrap(); let root = tx.get_or_create_bucket("ROOT").unwrap(); let child = root.get_or_create_bucket("CHILD").unwrap(); tx.commit().unwrap(); // panic! is here, page.rs:107: self.overflow = num_pages - 1; and num_pages is 0 } } let _ = std::fs::remove_file(TEST_DB); }
If I do all stuff in the single transaction everything is OK
fn main() { let _ = std::fs::remove_file(TEST_DB); { let db = jammdb::DB::open(TEST_DB).unwrap(); { let tx = db.tx(true).unwrap(); let root = tx.get_or_create_bucket("ROOT").unwrap(); // remove tx.commit() + db.tx() let root = tx.get_or_create_bucket("ROOT").unwrap(); let child = root.get_or_create_bucket("CHILD").unwrap(); tx.commit().unwrap(); } } let _ = std::fs::remove_file(TEST_DB); }
Unfortunately, the problem prevents me from using nested buckets at all
The text was updated successfully, but these errors were encountered:
Hey thanks for finding this, I should have some time later today to take a closer look, I'll let you know what I find!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The following code panics with
thread 'main' panicked at 'attempt to subtract with overflow', .../jammdb-0.5.0/src/page.rs:107:25
:If I do all stuff in the single transaction everything is OK
Unfortunately, the problem prevents me from using nested buckets at all
The text was updated successfully, but these errors were encountered: