diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 2d06f3b..513706d 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4939,7 +4939,8 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data, rc = MDB_NOTFOUND; mc->mc_ki[mc->mc_top]++; } else { - rc = 0; + /* new key is <= last key */ + rc = MDB_KEYEXIST; } } } else { @@ -6918,7 +6919,7 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, return EINVAL; } - if ((flags & (MDB_NOOVERWRITE|MDB_NODUPDATA|MDB_RESERVE|MDB_APPEND)) != flags) + if ((flags & (MDB_NOOVERWRITE|MDB_NODUPDATA|MDB_RESERVE|MDB_APPEND|MDB_APPENDDUP)) != flags) return EINVAL; mdb_cursor_init(&mc, txn, dbi, &mx);