From: Howard Chu Date: Sat, 21 Jan 2012 16:18:37 +0000 (-0800) Subject: ITS#7121 fix page splits when newindx == 0 X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~47 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1c8de1883c1a9c239a5ba69a291c07889c1fe7da;p=openldap ITS#7121 fix page splits when newindx == 0 --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index cdd46c98d7..9480a4339e 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -5585,6 +5585,8 @@ newsep: ins_new = 1; /* Update page and index for the new key. */ + if (!newindx) + mc->mc_pg[mc->mc_top] = copy; mc->mc_ki[mc->mc_top] = j; } else if (i == nkeys) { break; @@ -5620,7 +5622,7 @@ newsep: mc->mc_txn->mt_env->me_psize - copy->mp_upper); /* reset back to original page */ - if (newindx < split_indx) { + if (!newindx || (newindx < split_indx)) { mc->mc_pg[mc->mc_top] = mp; if (nflags & MDB_RESERVE) { node = NODEPTR(mp, mc->mc_ki[mc->mc_top]);