mdbx: backport - ITS#8334 Fix MDB_APPENDDUP vs. rewrite(single item).

Change-Id: I7742bd2e75ef670dac31a46d270a96ee28c20639
This commit is contained in:
Hallvard Furuseth 2015-12-08 16:43:55 +01:00 committed by Leo Yuriev
parent b848f5552f
commit 4fcbaa44f3

2
mdb.c
View File

@ -6640,7 +6640,7 @@ more:
/* does data match? */
if (!mc->mc_dbx->md_dcmp(data, &olddata)) {
if (unlikely(flags & MDB_NODUPDATA))
if (unlikely(flags & (MDB_NODUPDATA|MDB_APPENDDUP)))
return MDB_KEYEXIST;
/* overwrite it */
goto current;