From ab0b0ec7ce94b1e6421b520611229ffc456704dc Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 9 Nov 2015 20:09:10 +0000 Subject: [PATCH] mdbx: backport - ITS#8304 fix page_merge (mdb_del cursor tracking). Was using the pre-touch dst page pointer instead of the touched page Change-Id: Ib41af356dcf883b923dbfbbc7591a02483ee54dd --- CHANGES | 1 + mdb.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 0b63a13d..3880ee12 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ LMDB 0.9.17 Release Engineering Fix ITS#8264 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 Fix ITS#7771 fakepage cursor tracking Fix ITS#7789 ensure mapsize >= pages in use Fix ITS#7971 mdb_txn_renew0() new reader slots diff --git a/mdb.c b/mdb.c index 7840d16e..064d3d0e 100644 --- a/mdb.c +++ b/mdb.c @@ -7875,6 +7875,9 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) if (unlikely(rc = mdb_page_touch(cdst))) return rc; + /* get dst page again now that we've touched it. */ + pdst = cdst->mc_pg[cdst->mc_top]; + /* Move all nodes from src to dst. */ j = nkeys = NUMKEYS(pdst);