Skip to content

Commit cc2a50a

Browse files
committed
mdb_drop0(): Omit scanning DUPSORT sub-DB leaves
1 parent 70788bf commit cc2a50a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/liblmdb/mdb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9445,8 +9445,10 @@ mdb_drop0(MDB_cursor *mc, int subs)
94459445
MDB_cursor mx;
94469446
unsigned int i;
94479447

9448-
/* LEAF2 pages have no nodes, cannot have sub-DBs */
9449-
if (IS_LEAF2(mc->mc_pg[mc->mc_top]))
9448+
/* DUPSORT sub-DBs have no ovpages/DBs. Omit scanning leaves.
9449+
* This also avoids any P_LEAF2 pages, which have no nodes.
9450+
*/
9451+
if (mc->mc_flags & C_SUB)
94509452
mdb_cursor_pop(mc);
94519453

94529454
mdb_cursor_copy(mc, &mx);

0 commit comments

Comments
 (0)