From 87ea6a1089819313e274c7954ec1cd5513503908 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Wed, 31 Oct 2007 22:19:14 +0000
Subject: [PATCH] This set of fixes mainly address the issues where the JE backend does not handle attributes with options and subtypes correctly when they are being indexed. With this fix: - All values of an indexed attribute type will be indexed correctly on modifies, adds, and deletes. - Updates to subordinate types will now update the superior type if its indexed. - Adding and deleting superior attribute types that are not allowed by any object classes (ie. name) will be correctly handled - Deleting all values from an attribute with no options will no longer delete the values from the same attribute but with options.
---
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
index 556ebbf..7073463 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -3789,15 +3789,27 @@
{
// Check whether any modifications apply to this indexed attribute.
boolean attributeModified = false;
+ AttributeType indexAttributeType = index.getAttributeType();
+ Iterable<AttributeType> subTypes =
+ DirectoryServer.getSchema().getSubTypes(indexAttributeType);
+
for (Modification mod : mods)
{
Attribute modAttr = mod.getAttribute();
AttributeType modAttrType = modAttr.getAttributeType();
- if (modAttrType.equals(index.getAttributeType()))
+ if (modAttrType.equals(indexAttributeType))
{
attributeModified = true;
break;
}
+ for(AttributeType subType : subTypes)
+ {
+ if(modAttrType.equals(subType))
+ {
+ attributeModified = true;
+ break;
+ }
+ }
}
if (attributeModified)
{
--
Gitblit v1.10.0