From 8a8fb76cca459478f635bc67ae4525ce56e5d842 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 2 Oct 2011 21:29:21 -0700 Subject: [PATCH] Use MDB_APPEND mode where possible --- servers/slapd/back-mdb/dn2id.c | 2 +- servers/slapd/back-mdb/id2entry.c | 2 +- servers/slapd/back-mdb/tools.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.5