From 0a0d760704ad17f5f43ffc1782ad4d84f75de5a2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 May 2009 16:10:47 +1000 Subject: fixed one-level indexing one-level indexing was not always effective due to some broken logic in the indexing code. This change means that if normal indexing fails, we can still fall back on one-level indexing. This reduces the number of full unindexed searches in s4 quite a lot --- source4/lib/ldb/ldb_tdb/ldb_index.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb/ldb_index.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index c99c2936d8..db0c31572e 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1121,14 +1121,10 @@ int ltdb_search_indexed(struct ltdb_context *ac) if (ac->scope != LDB_SCOPE_BASE && idxattr == 1) { ret = ltdb_index_dn(ac->module, ac->tree, ltdb->cache->indexlist, dn_list); - - if (ret != LDB_SUCCESS && ret != LDB_ERR_NO_SUCH_OBJECT) { - talloc_free(dn_list); - return ret; - } } - if (ac->scope == LDB_SCOPE_ONELEVEL && idxone == 1) { + if (ret == LDB_ERR_OPERATIONS_ERROR && + ac->scope == LDB_SCOPE_ONELEVEL && idxone == 1) { ret = ltdb_index_dn_one(ac->module, ac->base, dn_list); } -- cgit