Append mode should *reject* keys that are too small.
Also allow APPENDDUP in mdb_put().
rc = MDB_NOTFOUND;
mc->mc_ki[mc->mc_top]++;
} else {
- rc = 0;
+ /* new key is <= last key */
+ rc = MDB_KEYEXIST;
}
}
} else {
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);