You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2011/10/24 18:36:31 UTC

svn commit: r1188212 - in /chemistry/opencmis/trunk: chemistry-opencmis-server/chemistry-opencmis-server-bindings/ chemistry-opencmis-server/chemistry-opencmis-server-inmemory/ chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/...

Author: fguillaume
Date: Mon Oct 24 16:36:30 2011
New Revision: 1188212

URL: http://svn.apache.org/viewvc?rev=1188212&view=rev
Log:
CMIS-456: fix query parser 'no fulltext parse' mode

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/   (props changed)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/   (props changed)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/antlr3/org/apache/chemistry/opencmis/server/support/query/CmisQueryWalker.g
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/   (props changed)

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Oct 24 16:36:30 2011
@@ -5,3 +5,5 @@
 target
 
 .settings
+
+bin

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Oct 24 16:36:30 2011
@@ -5,3 +5,6 @@
 target
 
 .settings
+
+bin
+log4j.log

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java?rev=1188212&r1=1188211&r2=1188212&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java Mon Oct 24 16:36:30 2011
@@ -474,6 +474,20 @@ public class QueryParseTest extends Abst
         checkTreeWhere(statement);
         Tree tree = findSearchExpression(statement);
         printSearchTree(tree, statement);
+        assertEquals("Beethoven", tree.getChild(0).getText());
+    }
+
+    @Test
+    public void whereTestContainsNoFulltextParse() throws Exception {
+        String statement = "SELECT p1 FROM MyType WHERE CONTAINS('Beethoven')";
+        walker = getWalker(statement);
+        walker.setDoFullTextParse(false);
+        walker.query(queryObj, predicateWalker);
+        Tree whereTree = walker.getWherePredicateTree();
+        Tree tree = findTextSearchNode(whereTree);
+        printSearchTree(tree, statement);
+        // unparsed, still with quotes
+        assertEquals("'Beethoven'", tree.getChild(0).getText());
     }
 
     @Test

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/antlr3/org/apache/chemistry/opencmis/server/support/query/CmisQueryWalker.g
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/antlr3/org/apache/chemistry/opencmis/server/support/query/CmisQueryWalker.g?rev=1188212&r1=1188211&r2=1188212&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/antlr3/org/apache/chemistry/opencmis/server/support/query/CmisQueryWalker.g (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/antlr3/org/apache/chemistry/opencmis/server/support/query/CmisQueryWalker.g Mon Oct 24 16:36:30 2011
@@ -319,11 +319,15 @@ text_search_expression
     CommonTree tse = null;
 }
 @after {
-   $tree = tse;
+   if (doFullTextParse) {
+       $tree = tse;
+   }
 } :
     STRING_LIT
     {
-        tse = doFullTextParse ? parseTextSearchPredicate($STRING_LIT.text) : $STRING_LIT;
+        if (doFullTextParse) {
+            tse = parseTextSearchPredicate($STRING_LIT.text);
+        }
     }
     ;
 

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Oct 24 16:36:30 2011
@@ -4,3 +4,4 @@ target
 *.ipr
 *.iml
 .*
+log4j.log