From b7502306c13b81cc14f289d1bf489803ac0aea49 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 12 Nov 2016 23:11:20 +0000 Subject: [PATCH] mdbx: backport - More for ITS#8406. Revert excess cursor fixup Change-Id: Ic1863feda49e793dd8890a77bd9bf223d1320826 --- CHANGES | 1 + mdb.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index dad2fe46..cb19ff64 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ MDBX Add MDB_PREV_MULTIPLE Fix MDB_CP_COMPACT (ITS#8209) Add error MDB_PROBLEM, replace some MDB_CORRUPTED + Backport fixes for ITS#8406 LMDB 0.9.19 Release Engineering Fix mdb_env_cwalk cursor init (ITS#8424) diff --git a/mdb.c b/mdb.c index 8cbbcd11..a1eaa683 100644 --- a/mdb.c +++ b/mdb.c @@ -8518,9 +8518,11 @@ mdb_cursor_del0(MDB_cursor *mc) } if (mc->mc_db->md_flags & MDB_DUPSORT) { MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); - if (node->mn_flags & F_DUPDATA) { + /* If this node is a fake page, it needs to be reinited + * because its data has moved. + */ + if ((node->mn_flags & (F_DUPDATA|F_SUBDATA)) == F_DUPDATA) { mdb_xcursor_init1(m3, node); - m3->mc_xcursor->mx_cursor.mc_flags |= C_DEL; } } }