directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r512204 - in /directory/apacheds/trunk: core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
Date Tue, 27 Feb 2007 10:13:52 GMT
Author: akarasulu
Date: Tue Feb 27 02:13:51 2007
New Revision: 512204

URL: http://svn.apache.org/viewvc?view=rev&rev=512204
Log:
fix for DIRSERVER-859

Modified:
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java?view=diff&rev=512204&r1=512203&r2=512204
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
Tue Feb 27 02:13:51 2007
@@ -308,4 +308,16 @@
         assertFalse( results.contains( "cn=testGroup4,ou=groups,ou=system" ) );
         assertFalse( results.contains( "cn=testGroup5,ou=groups,ou=system" ) );
     }
+
+    
+    public void testNotOperator() throws NamingException
+    {
+        Set results = searchGroups( "(!(gidNumber=4))" );
+        assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
+        assertFalse( results.contains( "cn=testGroup3,ou=groups,ou=system" ) );
+        assertFalse( results.contains( "cn=testGroup4,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup5,ou=groups,ou=system" ) );
+    }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?view=diff&rev=512204&r1=512203&r2=512204
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
Tue Feb 27 02:13:51 2007
@@ -225,8 +225,14 @@
             && !( onlyChild instanceof PresenceNode ) )
         {
             LeafNode leaf = ( LeafNode ) onlyChild;
-            Index idx = db.getUserIndex( leaf.getAttribute() );
-            return BigInteger.valueOf( idx.count() );
+            
+            if ( db.hasUserIndexOn( leaf.getAttribute() ) )
+            {
+                Index idx = db.getUserIndex( leaf.getAttribute() );
+                return BigInteger.valueOf( idx.count() );
+            }
+            
+            return BigInteger.valueOf( db.count() );
         }
 
         return BigInteger.valueOf( db.count() );



Mime
View raw message