Skip to content

Commit

Permalink
fix a bug around multi-index metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
irevoire committed Nov 4, 2024
1 parent 32670e7 commit 053807b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub fn ugrade_from_prev_version(
.put(wtxn, &key, &tree_node)?;
}
OldNodeMode::Metadata => {
match key.index {
match key.node.item {
0 => {
key.node.mode = NodeMode::Metadata;
// The distance has been renamed
Expand All @@ -256,7 +256,10 @@ pub fn ugrade_from_prev_version(
write_database.remap_types::<KeyCodec, Unit>().put(wtxn, &key, &())?;
}
}
_ => (),
other => {
let bytes = value.remap::<MetadataCodec>().decode().unwrap();
panic!("Unexpected {other} with value: {bytes:?}");
}
}
}
};
Expand Down

0 comments on commit 053807b

Please sign in to comment.