From c17cff1d4ed288ed63eeaa20a28d0c5ec1bffcc8 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 30 Mar 2016 00:04:10 +0300 Subject: [PATCH] check MDB_RESERVE against MDB_DUPSORT. Change-Id: I7459a92ecea867a5fd6510c828ff65cd551a1e9a --- mdb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mdb.c b/mdb.c index dbbb9871..eb9d3a5d 100644 --- a/mdb.c +++ b/mdb.c @@ -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;