From: Howard Chu Date: Fri, 13 Nov 2015 09:25:55 +0000 (+0000) Subject: ITS#8310 fix mdb_rebalance cursor fixup X-Git-Tag: LMDB_0.9.17~42 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a90415f3011399726a16e1d71d0ef757cda69896;p=openldap ITS#8310 fix mdb_rebalance cursor fixup When collapsing root, must adjust entire cursor stack --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 9af3704f78..fdfcb35109 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -7970,9 +7970,9 @@ mdb_rebalance(MDB_cursor *mc) m3 = &m2->mc_xcursor->mx_cursor; else m3 = m2; - if (m3 == mc || m3->mc_snum < mc->mc_snum) continue; + if (m3 == mc) continue; if (m3->mc_pg[0] == mp) { - for (i=0; imc_snum; i++) { + for (i=0; imc_db->md_depth; i++) { m3->mc_pg[i] = m3->mc_pg[i+1]; m3->mc_ki[i] = m3->mc_ki[i+1]; }