mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 15:49:34 -05:00
Fix d3990eb2f8
Append mode should *reject* keys that are too small. Also allow APPENDDUP in mdb_put().
This commit is contained in:
parent
e31d748dbe
commit
6beaad5212
1 changed files with 3 additions and 2 deletions
|
|
@ -4939,7 +4939,8 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
|
||||||
rc = MDB_NOTFOUND;
|
rc = MDB_NOTFOUND;
|
||||||
mc->mc_ki[mc->mc_top]++;
|
mc->mc_ki[mc->mc_top]++;
|
||||||
} else {
|
} else {
|
||||||
rc = 0;
|
/* new key is <= last key */
|
||||||
|
rc = MDB_KEYEXIST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -6918,7 +6919,7 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi,
|
||||||
return EINVAL;
|
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;
|
return EINVAL;
|
||||||
|
|
||||||
mdb_cursor_init(&mc, txn, dbi, &mx);
|
mdb_cursor_init(&mc, txn, dbi, &mx);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue