From 180d28dab780e9140db2d125b8693e9e4bdb9f14 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 21 Apr 2005 19:46:47 +0000 Subject: [PATCH] Fix typo, add Truncate support --- servers/slapd/back-bdb/config.c | 2 +- servers/slapd/back-bdb/dbcache.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 ); -- 2.39.5