]> git.sur5r.net Git - openldap/commitdiff
ITS#8310 fix mdb_rebalance cursor fixup
authorHoward Chu <hyc@openldap.org>
Fri, 13 Nov 2015 09:25:55 +0000 (09:25 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 13 Nov 2015 09:27:07 +0000 (09:27 +0000)
When collapsing root, must adjust entire cursor stack

libraries/liblmdb/mdb.c

index c7580a58c33d8e10bb0edf8a918a042c45134fe1..6c8f0cef32344a4e3ba15329de91db7a4c8e38ee 100644 (file)
@@ -8091,9 +8091,9 @@ mdb_rebalance(MDB_cursor *mc)
                                                m3 = &m2->mc_xcursor->mx_cursor;
                                        else
                                                m3 = m2;
-                                       if (m3 == mc || m3->mc_snum < mc->mc_snum) continue;
+                                       if (m3 == mc) continue;
                                        if (m3->mc_pg[0] == mp) {
-                                               for (i=0; i<m3->mc_snum; i++) {
+                                               for (i=0; i<mc->mc_db->md_depth; i++) {
                                                        m3->mc_pg[i] = m3->mc_pg[i+1];
                                                        m3->mc_ki[i] = m3->mc_ki[i+1];
                                                }