From: Howard Chu Date: Thu, 21 Apr 2005 19:46:47 +0000 (+0000) Subject: Fix typo, add Truncate support X-Git-Tag: OPENLDAP_AC_BP~849 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=180d28dab780e9140db2d125b8693e9e4bdb9f14;p=openldap Fix typo, add Truncate support --- diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index be86835e4d..776545de1b 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -226,7 +226,7 @@ bdb_online_index( void *ctx, void *arg ) continue; } if ( rc == DB_NOTFOUND ) { - id++ + id++; getnext = 1; continue; } diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index 3885b4c09a..faf1d3d159 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -124,6 +124,11 @@ bdb_db_cache( if ( !( slapMode & SLAP_TOOL_QUICK )) flags |= DB_AUTO_COMMIT; #endif + /* Cannot Truncate when Transactions are in use */ + if ( (slapMode & (SLAP_TOOL_QUICK|SLAP_TRUNCATE_MODE)) == + (SLAP_TOOL_QUICK|SLAP_TRUNCATE_MODE)) + flags |= DB_TRUNCATE; + rc = DB_OPEN( db->bdi_db, file, NULL /* name */, BDB_INDEXTYPE, bdb->bi_db_opflags | flags, bdb->bi_dbenv_mode );