Use MDB_APPEND mode where possible

This commit is contained in:
Howard Chu 2011-10-02 21:29:21 -07:00
parent 02cafebb8e
commit 8a8fb76cca
3 changed files with 3 additions and 3 deletions

View File

@ -199,7 +199,7 @@ mdb_dn2id_add(
memcpy( ptr, &pid, sizeof( ID ));
d->nrdnlen[0] ^= 0x80;
rc = mdb_cursor_put( mc, &key, &data, MDB_NODUPDATA );
rc = mdb_cursor_put( mc, &key, &data, MDB_NODUPDATA|MDB_APPEND );
}
mdb_cursor_close( mc );

View File

@ -92,7 +92,7 @@ int mdb_id2entry_add(
MDB_txn *tid,
Entry *e )
{
return mdb_id2entry_put(op, tid, e, MDB_NOOVERWRITE);
return mdb_id2entry_put(op, tid, e, MDB_NOOVERWRITE|MDB_APPEND);
}
int mdb_id2entry_update(

View File

@ -996,7 +996,7 @@ setrange:
for ( i=0; i<end; i++ ) {
if ( !ice->ids[i] ) continue;
data.mv_data = &ice->ids[i];
rc = mdb_cursor_put( mc, &key, &data, MDB_NODUPDATA );
rc = mdb_cursor_put( mc, &key, &data, MDB_NODUPDATA|MDB_APPEND );
if ( rc ) {
if ( rc == MDB_KEYEXIST ) {
rc = 0;