From 420c6c289681aa36dfcafba0497de55843aa9157 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Jun 15 2012 23:32:09 +0000 Subject: Trac Ticket #335 - transaction retries need to be cache aware https://fedorahosted.org/389/ticket/335 Fix description: Commit bddb5a45f2cd27705cb6629f436ef9a7e2248677 includes this fix: > Additinally, error checking for the conflict value in index_add_mods > was week (curr_attr). This patch is adding the check. The fix was incomplete. If an add-attempted attribute type itself does not exist in the entry (not only the attribute value) after mods applied, the attribute type/value should not have been indexed. This patch fixes it. --- diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index cfcd51f..43b68f5 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -647,18 +647,18 @@ index_add_mods( mods[i]->mod_op |= LDAP_MOD_IGNORE; } } - } - if (mods_valueArray) { - rc = index_addordel_values_sv( be, + if (mods_valueArray) { + rc = index_addordel_values_sv( be, mods[i]->mod_type, mods_valueArray, NULL, id, BE_INDEX_ADD, txn ); - if (rc) { - ldbm_nasty(errmsg, 1042, rc); - goto error; + if (rc) { + ldbm_nasty(errmsg, 1042, rc); + goto error; + } + } else { + rc = 0; } - } else { - rc = 0; } } break;