[btree] When creating a new multilayer btree the initial node should
have block_traits, rather than the ValueTraits.
This commit is contained in:
parent
e77e8715b0
commit
9470937b10
@ -404,11 +404,20 @@ namespace persistent_data {
|
|||||||
|
|
||||||
write_ref root = tm_->new_block(validator_);
|
write_ref root = tm_->new_block(validator_);
|
||||||
|
|
||||||
leaf_node n = to_node<ValueTraits>(root);
|
if (Levels > 1) {
|
||||||
n.set_type(btree_detail::LEAF);
|
internal_node n = to_node<block_traits>(root);
|
||||||
n.set_nr_entries(0);
|
n.set_type(btree_detail::LEAF);
|
||||||
n.set_max_entries();
|
n.set_nr_entries(0);
|
||||||
n.set_value_size(sizeof(typename ValueTraits::disk_type));
|
n.set_max_entries();
|
||||||
|
n.set_value_size(sizeof(typename block_traits::disk_type));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
leaf_node n = to_node<ValueTraits>(root);
|
||||||
|
n.set_type(btree_detail::LEAF);
|
||||||
|
n.set_nr_entries(0);
|
||||||
|
n.set_max_entries();
|
||||||
|
n.set_value_size(sizeof(typename ValueTraits::disk_type));
|
||||||
|
}
|
||||||
|
|
||||||
root_ = root.get_location();
|
root_ = root.get_location();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user