backporting fix for DIRSERVER-1376


git-svn-id: https://svn.apache.org/repos/asf/directory/apacheds/branches/ldif-partition@796140 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java b/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
index c8082ff..8d65b11 100644
--- a/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
+++ b/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
@@ -200,6 +200,8 @@
             subLevelIdx.add( tempId, id );
             tempId = getParentId( tempId );
         }
+        
+        // making entry an ancestor/descendent of itself in sublevel index
         subLevelIdx.add( id, id );
         
         // Now work on the user defined userIndices
@@ -273,7 +275,7 @@
         updnIdx.drop( id );
         oneLevelIdx.drop( id );
 
-        if( parentId != 1 )// should not use getParentId() to compare, onelevel index drops the 'id'
+        if( id != 1 )
         {
             subLevelIdx.drop( id );
         }