From: Hallvard Furuseth Date: Sat, 4 Jul 2015 11:48:02 +0000 (+0200) Subject: mdb_drop0(): Omit scanning DUPSORT sub-DB leaves X-Git-Tag: LMDB_0.9.17~77 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cc2a50aca226c18b2aaee4e92579f6e675761fc8;p=openldap mdb_drop0(): Omit scanning DUPSORT sub-DB leaves --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 7ba1a529f7..d08e3a7c10 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -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);