jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r410461 - in /jackrabbit/trunk/jackrabbit/src: main/javacc/sql/ test/java/org/apache/jackrabbit/core/query/ test/java/org/apache/jackrabbit/test/api/query/
Date Wed, 31 May 2006 08:21:23 GMT
Author: mreutegg
Date: Wed May 31 01:21:22 2006
New Revision: 410461

URL: http://svn.apache.org/viewvc?rev=410461&view=rev
Log:
JCR-436: InvalidQueryException thrown for a SQL query using WHERE CONTAINS(., 'someword')

Modified:
    jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SQLTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java

Modified: jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt?rev=410461&r1=410460&r2=410461&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt (original)
+++ jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt Wed May 31 01:21:22 2006
@@ -433,7 +433,7 @@
 {
   <CONTAINS>
   <LEFT_PAREN>
-  ( <ASTERISK> | (name = Identifier() { jjtThis.setPropertyName(name); }) ) ","
+  ( <ASTERISK> | <PERIOD> | (name = Identifier() { jjtThis.setPropertyName(name);
}) ) ","
   t = <CHAR_STRING_LITERAL> { jjtThis.setQuery(t.image.substring(1, t.image.length()
- 1).replaceAll("''", "'")); }
   <RIGHT_PAREN>
 }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java?rev=410461&r1=410460&r2=410461&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
Wed May 31 01:21:22 2006
@@ -34,7 +34,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE jcr:path LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, 'fox')";
+                + "' AND CONTAINS(., 'fox')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -48,7 +48,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" = '" + testRoot + "/foo"
-                + "' AND CONTAINS(*, 'fox')";
+                + "' AND CONTAINS(., 'fox')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -67,7 +67,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, 'fox test')";
+                + "' AND CONTAINS(., 'fox test')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -86,7 +86,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, 'text ''fox jumps''')";
+                + "' AND CONTAINS(., 'text ''fox jumps''')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -105,7 +105,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, 'text ''fox jumps'' -other')";
+                + "' AND CONTAINS(., 'text ''fox jumps'' -other')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -124,7 +124,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, '''fox jumps'' test OR other')";
+                + "' AND CONTAINS(., '''fox jumps'' test OR other')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
@@ -143,7 +143,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, '''fox juMps'' Test OR otheR')";
+                + "' AND CONTAINS(., '''fox juMps'' Test OR otheR')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
@@ -162,7 +162,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE jcr:path LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS(*, 'fox jumps')";
+                + "' AND CONTAINS(., 'fox jumps')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         checkResult(q.execute(), 2);
     }
@@ -282,7 +282,7 @@
         stmt = new StringBuffer();
         stmt.append("SELECT * FROM nt:base ");
         stmt.append("WHERE jcr:path LIKE '").append(testRoot).append("/%' ");
-        stmt.append("AND CONTAINS(*, '").append(statement).append("')");
+        stmt.append("AND CONTAINS(., '").append(statement).append("')");
 
         q = superuser.getWorkspace().getQueryManager().createQuery(stmt.toString(), Query.SQL);
         checkResult(q.execute(), match ? 1 : 0);

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SQLTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SQLTest.java?rev=410461&r1=410460&r2=410461&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SQLTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/query/SQLTest.java
Wed May 31 01:21:22 2006
@@ -44,7 +44,7 @@
 
         testRootNode.save();
 
-        String sql = "SELECT * FROM nt:unstructured WHERE contains(*, 'fox') " +
+        String sql = "SELECT * FROM nt:unstructured WHERE contains(., 'fox') " +
                 "AND jcr:path LIKE '" + testRoot + "/%'";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
@@ -58,7 +58,7 @@
         testRootNode.save();
 
         String sql = "SELECT foo.mytext, bla.foo FROM nt:unstructured WHERE " +
-                "contains(*, 'fox') AND NOT contains(*, 'bla') " +
+                "contains(., 'fox') AND NOT contains(., 'bla') " +
                 "AND jcr:path LIKE '" + testRoot + "/%'";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java?rev=410461&r1=410460&r2=410461&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
Wed May 31 01:21:22 2006
@@ -134,7 +134,7 @@
         StringBuffer tmp = new StringBuffer("SELECT ");
         tmp.append(propertyName1);
         tmp.append(" FROM ").append(testNodeType);
-        tmp.append(" WHERE CONTAINS(*, '''quick brown'' -cat')");
+        tmp.append(" WHERE CONTAINS(., '''quick brown'' -cat')");
         tmp.append(" AND ").append(jcrPath).append(" LIKE '");
         tmp.append(testRoot).append("/%'");
         return new Statement(tmp.toString(), Query.SQL);



Mime
View raw message