mdbx: fix mdbx_cursor_put().

Change-Id: I280c6f275372952ce3411e564928ad6c3387b00c
This commit is contained in:
Leonid Yuriev 2018-09-07 01:47:10 +03:00 committed by Leo Yuriev
parent 78143d9a48
commit 6d33c137f6

View File

@ -8333,6 +8333,10 @@ new_sub:
rc = mdbx_page_split(mc, key, rdata, P_INVALID, nflags); rc = mdbx_page_split(mc, key, rdata, P_INVALID, nflags);
} else { } else {
/* There is room already in this leaf page. */ /* There is room already in this leaf page. */
if (IS_LEAF2(mc->mc_pg[mc->mc_top])) {
mdbx_cassert(mc, nflags == 0 && rdata->iov_len == 0);
rc = mdbx_node_add_leaf2(mc, mc->mc_ki[mc->mc_top], key);
} else
rc = mdbx_node_add_leaf(mc, mc->mc_ki[mc->mc_top], key, rdata, nflags); rc = mdbx_node_add_leaf(mc, mc->mc_ki[mc->mc_top], key, rdata, nflags);
if (likely(rc == 0)) { if (likely(rc == 0)) {
/* Adjust other cursors pointing to mp */ /* Adjust other cursors pointing to mp */