From: Howard Chu Date: Thu, 19 Nov 2015 20:04:16 +0000 (+0000) Subject: ITS#8316 cursor fixup in page_merge X-Git-Tag: LMDB_0.9.17~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=28b57ba8b9ab29b0d89865911675815eec02f939;p=openldap ITS#8316 cursor fixup in page_merge Deleting the merged page requires bumping down other ki's of the page's parent. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 5cd4536efb..819a631910 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -7842,6 +7842,9 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) m3->mc_pg[top] = pdst; m3->mc_ki[top] += nkeys; m3->mc_ki[top-1] = cdst->mc_ki[top-1]; + } else if (m3->mc_pg[top-1] == csrc->mc_pg[top-1] && + m3->mc_ki[top-1] > csrc->mc_ki[top-1]) { + m3->mc_ki[top-1]--; } } }