jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1585661 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
Date Tue, 08 Apr 2014 08:22:17 GMT
Author: thomasm
Date: Tue Apr  8 08:22:17 2014
New Revision: 1585661

URL: http://svn.apache.org/r1585661
Log:
OAK-1693 "like '%'" does not use an index

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java?rev=1585661&r1=1585660&r2=1585661&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
Tue Apr  8 08:22:17 2014
@@ -129,6 +129,7 @@ public class ComparisonImpl extends Cons
             return p1.compareTo(p2) < 0;
         case LIKE:
             return evaluateLike(p1, p2);
+        // case IN is not needed here, as this is handled in the class InImpl.
         }
         throw new IllegalArgumentException("Unknown operator: " + operator);
     }
@@ -189,6 +190,9 @@ public class ComparisonImpl extends Cons
                         // path conditions
                         operand1.restrict(f, operator, v);
                     }
+                } else {
+                    // like '%' conditions
+                    operand1.restrict(f, operator, v);
                 }
             } else {
                 operand1.restrict(f, operator, v);

Modified: 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=1585661&r1=1585660&r2=1585661&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_index.txt
Tue Apr  8 08:22:17 2014
@@ -24,6 +24,12 @@
 # * new tests are typically be added on top, after the syntax docs
 # * use ascii character only
 
+explain select *
+  from [nt:base]
+  where [jcr:uuid] like '%'
+[nt:base] as [nt:base] /* property jcr:uuid
+  where [nt:base].[jcr:uuid] like cast('%' as string) */
+
 explain select e.[jcr:path]
   from [nt:base] as a
   inner join [nt:base] as b on ischildnode(b, a)



Mime
View raw message