From 86bd2da6ac69acc2df956260d081d03421116828 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Fri, 31 Aug 2018 14:28:22 +0100
Subject: [PATCH 034/109] Fix index delete

Deleting all indices should also reset default mask
---
 servers/slapd/back-bdb/config.c | 3 ++-
 servers/slapd/back-mdb/config.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c
index a1cd0d605..24c4753ba 100644
--- a/servers/slapd/back-bdb/config.c
+++ b/servers/slapd/back-bdb/config.c
@@ -602,10 +602,11 @@ bdb_cf_gen( ConfigArgs *c )
 			if ( c->valx == -1 ) {
 				int i;
 
-				/* delete all (FIXME) */
+				/* delete all */
 				for ( i = 0; i < bdb->bi_nattrs; i++ ) {
 					bdb->bi_attrs[i]->ai_indexmask |= BDB_INDEX_DELETING;
 				}
+				bdb->bi_defaultmask = 0;
 				bdb->bi_flags |= BDB_DEL_INDEX;
 				c->cleanup = bdb_cf_cleanup;
 
diff --git a/servers/slapd/back-mdb/config.c b/servers/slapd/back-mdb/config.c
index d4c6f96aa..ded7a087c 100644
--- a/servers/slapd/back-mdb/config.c
+++ b/servers/slapd/back-mdb/config.c
@@ -423,10 +423,11 @@ mdb_cf_gen( ConfigArgs *c )
 			if ( c->valx == -1 ) {
 				int i;
 
-				/* delete all (FIXME) */
+				/* delete all */
 				for ( i = 0; i < mdb->mi_nattrs; i++ ) {
 					mdb->mi_attrs[i]->ai_indexmask |= MDB_INDEX_DELETING;
 				}
+				mdb->mi_defaultmask = 0;
 				mdb->mi_flags |= MDB_DEL_INDEX;
 				c->cleanup = mdb_cf_cleanup;
 
-- 
2.19.1

