mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
15.36.2011 49acda22d986cb5e6730ac99d24e8d7362e4d7aa
Fix issue OPENDJ-46: Extensible filters which use dnAttributes are not processed correctly when there is an existing index for the named attribute

https://bugster.forgerock.org/jira/browse/OPENDJ-46
1 files modified
24 ■■■■ changed files
opends/src/server/org/opends/server/backends/jeb/IndexFilter.java 24 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/jeb/IndexFilter.java
@@ -23,6 +23,8 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 *
 */
package org.opends.server.backends.jeb;
@@ -659,17 +661,27 @@
  private EntryIDSet evaluateExtensibleFilter(SearchFilter extensibleFilter)
  {
    EntryIDSet candidates;
    AttributeIndex attributeIndex =
         entryContainer.getAttributeIndex(extensibleFilter.getAttributeType());
    if (attributeIndex == null)
    if (extensibleFilter.getDNAttributes())
    {
      // This will always be unindexed since the filter potentially matches
      // entries containing the specified attribute type as well as any entry
      // containing the attribute in its DN as part of a superior RDN.
      candidates = IndexQuery.createNullIndexQuery().evaluate(null);
    }
    else
    {
      candidates =
          attributeIndex.evaluateExtensibleFilter(extensibleFilter, buffer,
              monitor);
      AttributeIndex attributeIndex = entryContainer
          .getAttributeIndex(extensibleFilter.getAttributeType());
      if (attributeIndex == null)
      {
        candidates = IndexQuery.createNullIndexQuery().evaluate(null);
      }
      else
      {
        candidates = attributeIndex.evaluateExtensibleFilter(extensibleFilter,
            buffer, monitor);
      }
    }
    return candidates;
  }