From e25d897908d93ab4f9cabadb1029ad3352602d5d 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.  

---
 opends/src/server/org/opends/server/backends/jeb/VLVIndex.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java b/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java
index 0f24189..00de153 100644
--- a/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java
+++ b/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java
@@ -383,14 +383,25 @@
         SortKey[] sortKeys = sortOrder.getSortKeys();
         for(SortKey sortKey : sortKeys)
         {
+          AttributeType attributeType = sortKey.getAttributeType();
+          Iterable<AttributeType> subTypes =
+              DirectoryServer.getSchema().getSubTypes(attributeType);
           for(Modification mod : mods)
           {
-            if(mod.getAttribute().getAttributeType().
-                equals(sortKey.getAttributeType()))
+            AttributeType modAttrType = mod.getAttribute().getAttributeType();
+            if(modAttrType.equals(attributeType))
             {
               sortAttributeModified = true;
               break;
             }
+            for(AttributeType subType : subTypes)
+            {
+              if(modAttrType.equals(subType))
+              {
+                sortAttributeModified = true;
+                break;
+              }
+            }
           }
           if(sortAttributeModified)
           {

--
Gitblit v1.10.0