]> git.sur5r.net Git - openldap/commitdiff
ITS#8300 more for node_move
authorHoward Chu <hyc@openldap.org>
Fri, 6 Nov 2015 10:12:45 +0000 (10:12 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 6 Nov 2015 10:19:49 +0000 (10:19 +0000)
When moving a node from one page to another, make sure other cursors'
parent index gets adjusted too.

libraries/liblmdb/mdb.c

index 84af6293961a8d8f23e7920ec42683f81dad7905..3df4a1d2f43c368de9a36863affea64eb972f207 100644 (file)
@@ -7617,6 +7617,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
@@ -7632,6 +7633,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]--;
                                        }