summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2009-08-12 08:36:58 -0700
committerRich Megginson <rmeggins@redhat.com>2009-08-12 12:47:36 -0600
commit421618180320be6d1a3f055c3ef99c0c2c0a8790 (patch)
tree8299accc1a62b13fe8ca8111a8809e4abeafeda0
parentb2c5e72befb090c853a568d269b5ea66620adbc0 (diff)
downloadds-421618180320be6d1a3f055c3ef99c0c2c0a8790.tar.gz
ds-421618180320be6d1a3f055c3ef99c0c2c0a8790.tar.xz
ds-421618180320be6d1a3f055c3ef99c0c2c0a8790.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.
-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;
}
}
/*