]> git.sur5r.net Git - openldap/commitdiff
ITS#7594 better fix
authorHoward Chu <hyc@symas.com>
Wed, 5 Jun 2013 22:23:54 +0000 (15:23 -0700)
committerHoward Chu <hyc@symas.com>
Wed, 5 Jun 2013 22:23:54 +0000 (15:23 -0700)
Update the subDB cursor, don't invalidate it

libraries/liblmdb/mdb.c

index 33b9d4766820c485ecccd3d97a961d7b803e2307..0e14320214b5b8e56b496c6e1b1a09d5abc7bc34 100644 (file)
@@ -1636,8 +1636,13 @@ finish:
                                if (m2 == mc || m2->mc_snum < mc->mc_snum) continue;
                                if (m2->mc_pg[mc->mc_top] == mc->mc_pg[mc->mc_top]) {
                                        m2->mc_pg[mc->mc_top] = mp;
-                                       if (mc->mc_db->md_flags & MDB_DUPSORT)
-                                               m2->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
+                                       if ((mc->mc_db->md_flags & MDB_DUPSORT) &&
+                                               m2->mc_ki[mc->mc_top] == mc->mc_ki[mc->mc_top]) {
+                                               MDB_node *leaf = NODEPTR(mp, mc->mc_ki[mc->mc_top]);
+                                               if (!(leaf->mn_flags & F_SUBDATA)) {
+                                                       m2->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(leaf);
+                                               }
+                                       }
                                }
                        }
                }