jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cki...@apache.org
Subject svn commit: r572885 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
Date Wed, 05 Sep 2007 06:34:31 GMT
Author: ckiehl
Date: Tue Sep  4 23:34:28 2007
New Revision: 572885

URL: http://svn.apache.org/viewvc?rev=572885&view=rev
Log:
JCR-1041: ChildAxisScorer.skipTo() should check nextDoc > -1

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java?rev=572885&r1=572884&r2=572885&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
Tue Sep  4 23:34:28 2007
@@ -268,7 +268,7 @@
             calculateChildren();
             do {
                 nextDoc = hits.next();
-            } while (nextDoc >= 0 && !indexIsValid(nextDoc));
+            } while (nextDoc > -1 && !indexIsValid(nextDoc));
             
             return nextDoc > -1;
         }
@@ -293,7 +293,7 @@
         public boolean skipTo(int target) throws IOException {
             calculateChildren();
             nextDoc = hits.skipTo(target);
-            while (!indexIsValid(nextDoc))
+            while (nextDoc > -1 && !indexIsValid(nextDoc))
                 next();
             return nextDoc > -1;            
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java?rev=572885&r1=572884&r2=572885&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
Tue Sep  4 23:34:28 2007
@@ -16,12 +16,13 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.Node;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
+import javax.jcr.RepositoryException;
+
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.util.Calendar;
 
 /**
@@ -231,4 +232,15 @@
         executeXPathQuery(base + "*/*, 'lazy')]",
                 new Node[]{});
     }
+    
+    public void testSimpleQuery() throws Exception {
+        Node foo = testRootNode.addNode("foo");
+        testRootNode.addNode("bar");
+       
+        testRootNode.save();
+
+        String sql = "SELECT * FROM nt:unstructured WHERE jcr:path LIKE '"+testRoot+"/foo'";
+        executeSQLQuery(sql, new Node[] {foo});
+    }
+    
 }



Mime
View raw message