jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1421301 - in /jackrabbit/oak/trunk/oak-core/src/test: java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java resources/org/apache/jackrabbit/oak/query/sql2_index.txt
Date Thu, 13 Dec 2012 13:58:55 GMT
Author: thomasm
Date: Thu Dec 13 13:58:54 2012
New Revision: 1421301

URL: http://svn.apache.org/viewvc?rev=1421301&view=rev
Log:
OAK-515 PropertyIndex should be used for "[indexedProperty] is not null" (illustrates the
issue)

Added:
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java?rev=1421301&r1=1421300&r2=1421301&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
Thu Dec 13 13:58:54 2012
@@ -20,6 +20,7 @@ import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
+import org.junit.Test;
 
 /**
  * Tests the query engine using the default index implementation: the
@@ -35,5 +36,10 @@ public class PropertyIndexQueryTest exte
             .with(new PropertyIndexHookProvider())
             .createContentRepository();
     }
+    
+    @Test
+    public void sql2Index() throws Exception {
+        test("sql2_index.txt");
+    }
 
 }
\ No newline at end of file

Added: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt?rev=1421301&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
(added)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
Thu Dec 13 13:58:54 2012
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Syntax:
+# * lines starting with "#" are remarks.
+# * lines starting with "select" are queries, followed by expected results and an empty line
+# * lines starting with "explain" are followed by expected query plan and an empty line
+# * lines starting with "sql1" are run using the sql1 language
+# * lines starting with "xpath2sql" are just converted from xpath to sql2
+# * all other lines are are committed into the microkernel (line by line)
+# * new tests are typically be added on top, after the syntax docs
+# * use ascii character only
+
+# property type (value prefix) index
+
+explain select * from [nt:base] where [jcr:uuid] = '123'
+[nt:base] as [nt:base] /* oak:index where [nt:base].[jcr:uuid] = cast('123' as string) */
+
+select * from [nt:base] where [jcr:uuid] = '123'
+
+explain select * from [nt:base] where [jcr:uuid] is not null
+[nt:base] as [nt:base] /* traverse "//*" where [nt:base].[jcr:uuid] is not null */



Mime
View raw message