Skip to content

Commit da83fb4

Browse files
committed
fix reading of empty serialized btrees
1 parent a0b6e32 commit da83fb4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tpie/btree/serialized_store.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,9 @@ class serialized_store {
398398
metadata_size = h.metadata_size;
399399

400400
set_flags(h.flags);
401-
402-
if (m_height == 1) {
401+
if (m_height == 0) {
402+
root_leaf = leaf_type(0);
403+
} else if (m_height == 1) {
403404
root_leaf = leaf_type(h.root);
404405
f->seekg(h.root);
405406
unserialize(*f, *root_leaf);

0 commit comments

Comments
 (0)