From 9fa0c3bf31f256bac8643980c97b7696a3947806 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 29 Jan 2013 01:08:24 +0000 Subject: [PATCH] ITS#7505 fix prev commit, partial revert --- libraries/liblmdb/mdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5