check MDB_RESERVE against MDB_DUPSORT.

Change-Id: I7459a92ecea867a5fd6510c828ff65cd551a1e9a
This commit is contained in:
Leo Yuriev 2016-03-30 00:04:10 +03:00
parent b59f25fd46
commit c17cff1d4e

5
mdb.c
View File

@ -6543,6 +6543,11 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
return MDB_INCOMPATIBLE;
}
if (flags & MDB_RESERVE) {
if (unlikely(mc->mc_db->md_flags & (MDB_DUPSORT | MDB_REVERSEDUP)))
return MDB_INCOMPATIBLE;
}
nospill = flags & MDB_NOSPILL;
flags &= ~MDB_NOSPILL;