[btree] When creating a new multilayer btree the initial node should

have block_traits, rather than the ValueTraits.
This commit is contained in:
Joe Thornber 2014-07-02 15:02:32 +01:00
parent e77e8715b0
commit 9470937b10

View File

@ -404,11 +404,20 @@ namespace persistent_data {
write_ref root = tm_->new_block(validator_);
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));
if (Levels > 1) {
internal_node n = to_node<block_traits>(root);
n.set_type(btree_detail::LEAF);
n.set_nr_entries(0);
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();
}