From 0fdfdf320c5e043f424ea744e7a162cb932bc480 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 6 Nov 2015 10:12:45 +0000 Subject: [PATCH] ITS#8300 more for node_move When moving a node from one page to another, make sure other cursors' parent index gets adjusted too. --- libraries/liblmdb/mdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index a4d1f6146f..59222cadea 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -7738,6 +7738,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst) m3->mc_ki[csrc->mc_top] == csrc->mc_ki[csrc->mc_top]) { m3->mc_pg[csrc->mc_top] = cdst->mc_pg[cdst->mc_top]; m3->mc_ki[csrc->mc_top] = cdst->mc_ki[cdst->mc_top]; + m3->mc_ki[csrc->mc_top-1]++; } } } else @@ -7753,6 +7754,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst) if (!m3->mc_ki[csrc->mc_top]) { m3->mc_pg[csrc->mc_top] = cdst->mc_pg[cdst->mc_top]; m3->mc_ki[csrc->mc_top] = cdst->mc_ki[cdst->mc_top]; + m3->mc_ki[csrc->mc_top-1]--; } else { m3->mc_ki[csrc->mc_top]--; } -- 2.39.5