From: Howard Chu Date: Mon, 3 Oct 2011 04:29:21 +0000 (-0700) Subject: Use MDB_APPEND mode where possible X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8a8fb76cca459478f635bc67ae4525ce56e5d842;p=openldap Use MDB_APPEND mode where possible --- diff --git a/servers/slapd/back-mdb/dn2id.c b/servers/slapd/back-mdb/dn2id.c index 2550b69592..5431226ae4 100644 --- a/servers/slapd/back-mdb/dn2id.c +++ b/servers/slapd/back-mdb/dn2id.c @@ -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 ); diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 1b8707e634..afa7539fdd 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -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( diff --git a/servers/slapd/back-mdb/tools.c b/servers/slapd/back-mdb/tools.c index dfc9565434..79ef877f43 100644 --- a/servers/slapd/back-mdb/tools.c +++ b/servers/slapd/back-mdb/tools.c @@ -996,7 +996,7 @@ setrange: for ( i=0; iids[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;