Skip to content

Commit e6f7ba0

Browse files
committed
Tolerate duplicate values and discard them
1 parent e764d2c commit e6f7ba0

File tree

1 file changed

+4
-2
lines changed
  • dependencies/lmdb/libraries/liblmdb

1 file changed

+4
-2
lines changed

dependencies/lmdb/libraries/liblmdb/mdb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,8 +3007,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp)
30073007
/* Merge in descending sorted order */
30083008
//fprintf(stderr, "Merging %u: ", last);
30093009
//mdb_midl_print(stderr, idl);
3010-
if ((rc = mdb_midl_xmerge(&mop, idl)) != 0)
3011-
goto fail;
3010+
if ((rc = mdb_midl_xmerge(&mop, idl)) != 0) {
3011+
if (rc == -1) rc = 0; // ignore duplicate value errors and just ignore the duplicates
3012+
else goto fail;
3013+
}
30123014
if (mop != env->me_pghead) env->me_pghead = mop;
30133015
mop_len = mop[0];
30143016
}

0 commit comments

Comments
 (0)