jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1513815 - in /jackrabbit/branches/2.6: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java
Date Wed, 14 Aug 2013 11:29:11 GMT
Author: alexparvulescu
Date: Wed Aug 14 11:29:10 2013
New Revision: 1513815

URL: http://svn.apache.org/r1513815
Log:
JCR-3398 LOWER operand with nested LOCALNAME operand does not work with SQL2
 - backported to the 2.6 branch


Modified:
    jackrabbit/branches/2.6/   (props changed)
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
    jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java

Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1513144

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java?rev=1513815&r1=1513814&r2=1513815&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
Wed Aug 14 11:29:10 2013
@@ -669,9 +669,7 @@ public class LuceneQueryFactory {
 
     protected Query getNodeLocalNameQuery(int transform, String operator,
             StaticOperand right) throws RepositoryException {
-        if (transform != TRANSFORM_NONE
-                || (!JCR_OPERATOR_EQUAL_TO.equals(operator) && !JCR_OPERATOR_LIKE
-                        .equals(operator))) {
+        if (!JCR_OPERATOR_EQUAL_TO.equals(operator) && !JCR_OPERATOR_LIKE.equals(operator))
{
             throw new UnsupportedRepositoryOperationException();
         }
         String name = evaluator.getValue(right).getString();

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java?rev=1513815&r1=1513814&r2=1513815&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2NodeLocalNameTest.java
Wed Aug 14 11:29:10 2013
@@ -22,7 +22,7 @@ import org.apache.jackrabbit.commons.Jcr
 
 /**
  * Test case for Node LocalName queries with JCR_SQL2
- * 
+ *
  * Inspired by <a
  * href="https://issues.apache.org/jira/browse/JCR-2956">JCR-2956</a>
  */
@@ -118,4 +118,22 @@ public class SQL2NodeLocalNameTest exten
                 executeSQL2Query("SELECT * FROM [nt:base] as NODE WHERE LOWER(name(NODE))
like 'sql2nodelocalnametest%'"),
                 2);
     }
+
+    /**
+     * test for JCR-3398
+     */
+    public void testLowerLocalNameOrContains() throws Exception {
+        checkResult(
+                executeSQL2Query("SELECT * FROM [nt:base] as NODE WHERE LOWER(localname(NODE))
like 'sql2nodelocalnametest%' OR contains(NODE.*, 'sql2nodelocalnametest')"),
+                2);
+    }
+
+    /**
+     * test for JCR-3398
+     */
+    public void testUpperLocalNameOrContains() throws Exception {
+        checkResult(
+                executeSQL2Query("SELECT * FROM [nt:base] as NODE WHERE UPPER(localname(NODE))
like 'SQL2NODELOCALNAMETEST%' OR contains(NODE.*, 'SQL2NODELOCALNAMETEST')"),
+                2);
+    }
 }



Mime
View raw message