Commit bee191b7 authored by marko's avatar marko

branches/zip: Fix a bug in the insertion of a record.

page_dir_split_slot(): Do not pass page_zip to page_dir_slot_set_n_owned(),
because the caller will rewrite the dense page directory later.  At this
point of execution, the dense directory will not contain the newly inserted
record, which may end up being written to new_slot.
parent 4ea9fe18
...@@ -1251,12 +1251,14 @@ page_dir_split_slot( ...@@ -1251,12 +1251,14 @@ page_dir_split_slot(
/* 3. We store the appropriate values to the new slot. */ /* 3. We store the appropriate values to the new slot. */
page_dir_slot_set_rec(new_slot, rec); page_dir_slot_set_rec(new_slot, rec);
page_dir_slot_set_n_owned(new_slot, page_zip, n_owned / 2); /* Pass page_zip==NULL here, because the caller will rewrite
the dense page directory by invoking page_zip_dir_rewrite(). */
page_dir_slot_set_n_owned(new_slot, NULL, n_owned / 2);
/* 4. Finally, we update the number of records field of the /* 4. Finally, we update the number of records field of the
original slot */ original slot */
page_dir_slot_set_n_owned(slot, page_zip, n_owned - (n_owned / 2)); page_dir_slot_set_n_owned(slot, NULL, n_owned - (n_owned / 2));
} }
/***************************************************************** /*****************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment