From: Howard Chu Date: Tue, 29 Jan 2013 01:08:24 +0000 (+0000) Subject: ITS#7505 fix prev commit, partial revert X-Git-Tag: OPENLDAP_REL_ENG_2_4_34~22^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9fa0c3bf31f256bac8643980c97b7696a3947806;p=openldap ITS#7505 fix prev commit, partial revert --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 061d75245b..0ef43d6154 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6320,12 +6320,13 @@ mdb_rebalance(MDB_cursor *mc) * Otherwise we should try to merge them. */ if (PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) >= FILL_THRESHOLD && NUMKEYS(mn.mc_pg[mn.mc_top]) >= 2) - rc = mdb_node_move(&mn, mc); + return mdb_node_move(&mn, mc); else { if (mc->mc_ki[ptop] == 0) rc = mdb_page_merge(&mn, mc); else rc = mdb_page_merge(mc, &mn); + mc->mc_flags &= ~C_INITIALIZED; } return rc; } @@ -6353,7 +6354,6 @@ mdb_cursor_del0(MDB_cursor *mc, MDB_node *leaf) mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], mc->mc_db->md_pad); mc->mc_db->md_entries--; rc = mdb_rebalance(mc); - mc->mc_flags &= ~C_INITIALIZED; if (rc != MDB_SUCCESS) mc->mc_txn->mt_flags |= MDB_TXN_ERROR;