From: Howard Chu Date: Sat, 21 Sep 2013 21:37:11 +0000 (-0700) Subject: ITS#7701 fix mdb_rebalance X-Git-Tag: OPENLDAP_REL_ENG_2_4_37~27^2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0144da6eab00cf5f321d5c6794175485ba3efefd;p=openldap ITS#7701 fix mdb_rebalance Must copy tmp cursor back to real cursor when merging into tmp cursor. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 9c5e7389de..e5313b0c85 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -7248,8 +7248,11 @@ mdb_rebalance(MDB_cursor *mc) else { if (mc->mc_ki[ptop] == 0) rc = mdb_page_merge(&mn, mc); - else + else { + mn.mc_ki[mn.mc_top] += mc->mc_ki[mn.mc_top] + 1; rc = mdb_page_merge(mc, &mn); + mdb_cursor_copy(&mn, mc); + } mc->mc_flags &= ~(C_INITIALIZED|C_EOF); } return rc;