summaryrefslogtreecommitdiffstats
path: root/ldap
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2009-08-12 08:36:58 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2009-08-12 08:36:58 -0700
commit20d6a63f0a776f0726a24fdcddf94399b9d880b1 (patch)
treecff15aa2d3a8ac4e2f43bb2b0e4eb14cc4fc99ff /ldap
parent65fef7efba36dd75d41344d423283047ce07e818 (diff)
downloadds-20d6a63f0a776f0726a24fdcddf94399b9d880b1.tar.gz
ds-20d6a63f0a776f0726a24fdcddf94399b9d880b1.tar.xz
ds-20d6a63f0a776f0726a24fdcddf94399b9d880b1.zip
506786 Index maintenance mechanism causes wrong search results when
modifying attributes with subtypes Andrey Ivanov (andrey.ivanov@polytechnique.fr) pointed out my previous check-in for bug 506786 had an inefficient code. To determine whether to delete an equality index key or not, the code checks the key still exists in the value array having the same attribute type. The check should be done as soon as one value is found in the value array instead of checking through all of them.
Diffstat (limited to 'ldap')
-rw-r--r--ldap/servers/slapd/back-ldbm/index.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index c4b905c2..31252569 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -658,7 +658,10 @@ index_add_mods(
int found = 0;
for (j = 0; mods_valueArray[j] != NULL; j++ ) {
if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) > -1 ) {
+ /* The same value found in evals.
+ * We don't touch the equality index. */
found = 1;
+ break;
}
}
/*