Added sparse B-tree name tests, fixed weight-calculation bug during merge

More proof the tests are working.

This bug was in the code that does an extra lookup for the was-split entry
during merge, so we make sure we have the right id to attach the split
name to. Humorously, this code was already set up correctly, the
"split_id" just wasn't actually used. Unfortunately since
lfsr_rbyd_lookup uses out-pointers to return multiple things the
compiler couldn't detect the unused variable.
This commit is contained in:
Christopher Haster
2023-03-20 22:00:24 -05:00
parent 89d5a5ef80
commit 23956cc25b
2 changed files with 109 additions and 64 deletions
+1 -1
View File
@@ -3603,7 +3603,7 @@ static int lfsr_btree_commit(lfs_t *lfs,
}
err = lfsr_rbyd_append(lfs, &rbyd_,
LFSR_TAG_MKBRANCH, (sdelta == 0 ? sweight : rweight),
LFSR_TAG_MKBRANCH, split_id,
LFSR_DATA_DISK(parent.block, split_off, split_size));
if (err) {
assert(!err);