mdbx: fix MDB_CURRENT for mdb_cursor_put() with MDB_DUPSORT.

This commit is contained in:
Leo Yuriev 2017-01-24 20:51:23 +03:00
parent 6aa60c61c5
commit cc6e1c5119

5
mdb.c
View File

@ -6902,8 +6902,11 @@ more:
/* Was a single item before, must convert now */
if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
/* Just overwrite the current item */
if (flags == MDB_CURRENT)
if (flags & MDB_CURRENT) {
if ((flags & MDB_NODUPDATA) && !mc->mc_dbx->md_dcmp(data, &olddata))
return MDB_KEYEXIST;
goto current;
}
/* does data match? */
if (!mc->mc_dbx->md_dcmp(data, &olddata)) {