]> git.sur5r.net Git - openldap/commitdiff
mdb_drop0(): Omit scanning DUPSORT sub-DB leaves
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 4 Jul 2015 11:48:02 +0000 (13:48 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 25 Oct 2015 09:55:21 +0000 (10:55 +0100)
libraries/liblmdb/mdb.c

index 7ba1a529f74d49555d91984c6f93915222df76c9..d08e3a7c1079ff011b652394c4a81cebf6fbf232 100644 (file)
@@ -9445,8 +9445,10 @@ mdb_drop0(MDB_cursor *mc, int subs)
                MDB_cursor mx;
                unsigned int i;
 
-               /* LEAF2 pages have no nodes, cannot have sub-DBs */
-               if (IS_LEAF2(mc->mc_pg[mc->mc_top]))
+               /* DUPSORT sub-DBs have no ovpages/DBs. Omit scanning leaves.
+                * This also avoids any P_LEAF2 pages, which have no nodes.
+                */
+               if (mc->mc_flags & C_SUB)
                        mdb_cursor_pop(mc);
 
                mdb_cursor_copy(mc, &mx);