From 380c61bcf725d760362317176a2ca3f4cd601c8f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 13 Nov 2015 09:25:55 +0000 Subject: [PATCH] mdbx: backport - ITS#8310 fix mdb_rebalance cursor fixup. When collapsing root, must adjust entire cursor stack Change-Id: If62c42f556311e785aa414954a3d7fddc077cf62 --- CHANGES | 1 + mdb.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3880ee12..15ea76d9 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ LMDB 0.9.17 Release Engineering Fix ITS#8258 rebalance/split assert Fix ITS#8263 cursor_put cursor tracking Fix ITS#8264 cursor_del cursor tracking + Fix ITS#8310 cursor_del cursor tracking Fix ITS#8299 mdb_del cursor tracking Fix ITS#8300 mdb_del cursor tracking Fix ITS#8304 mdb_del cursor tracking diff --git a/mdb.c b/mdb.c index 064d3d0e..afafd152 100644 --- a/mdb.c +++ b/mdb.c @@ -8103,9 +8103,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]; }