jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r479968 - in /jackrabbit/trunk/jackrabbit/src: main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Date Tue, 28 Nov 2006 09:53:18 GMT
Author: mreutegg
Date: Tue Nov 28 01:53:18 2006
New Revision: 479968

URL: http://svn.apache.org/viewvc?view=rev&rev=479968
Log:
JCR-649: Like expression does not match line terminator in String

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java?view=diff&rev=479968&r1=479967&r2=479968
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardTermEnum.java
Tue Nov 28 01:53:18 2006
@@ -195,7 +195,7 @@
                 }
             }
         }
-        return Pattern.compile(regexp.toString());
+        return Pattern.compile(regexp.toString(), Pattern.DOTALL);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java?view=diff&rev=479968&r1=479967&r2=479968
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Tue Nov 28 01:53:18 2006
@@ -279,6 +279,23 @@
         checkResult(result, 1);
     }
 
+    public void testLikeWithLineTerminator() throws Exception {
+        Node n = testRootNode.addNode("node1");
+        n.setProperty("value", new String[]{"foo\nbar"});
+
+        testRootNode.save();
+
+        String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND
value LIKE 'foo%bar'";
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+        QueryResult result = q.execute();
+        checkResult(result, 1);
+
+        sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE
'foo_bar'";
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+        result = q.execute();
+        checkResult(result, 1);
+    }
+
     public void testNotEqual() throws Exception {
         Node n = testRootNode.addNode("node1");
         n.setProperty("value", new String[]{"foo"});



Mime
View raw message