diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-05-28 16:10:47 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-05-28 16:10:47 +1000 |
commit | 0a0d760704ad17f5f43ffc1782ad4d84f75de5a2 (patch) | |
tree | 0864e91e35706f0f43c96768323b58e2acb7b0c1 /source4/lib/ldb | |
parent | 52cfffb8cba92e272224febd3d8df68b93e29bc7 (diff) | |
download | samba-0a0d760704ad17f5f43ffc1782ad4d84f75de5a2.tar.gz samba-0a0d760704ad17f5f43ffc1782ad4d84f75de5a2.tar.bz2 samba-0a0d760704ad17f5f43ffc1782ad4d84f75de5a2.zip |
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
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 8 |
1 files changed, 2 insertions, 6 deletions
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); } |