From e31d748dbe16b326fb2e80c1b876814cf7b24f45 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 1 Apr 2013 20:34:40 -0700 Subject: [PATCH] Fix rebalance when collapsing root page When fixing other cursors, must also fix their depth. --- libraries/liblmdb/mdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 28f3452..2d06f3b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6341,6 +6341,8 @@ mdb_rebalance(MDB_cursor *mc) if (m3->mc_snum < mc->mc_snum) continue; if (m3->mc_pg[0] == mp) { m3->mc_pg[0] = mc->mc_pg[0]; + m3->mc_snum = 1; + m3->mc_top = 0; } } }