Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-3999

ParseException thrown for xpath query on 3 or more jcr:primaryType "or" conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.3.16, 1.4
    • query
    • None

    Description

      Query
      //*[(@jcr:primaryType = 'nt:base' or @jcr:primaryType = 'nt:base' or @jcr:primaryType = 'nt:base')]
      throws

      java.text.ParseException: Query: select [jcr:path], [jcr:score], * from [nt:base] as a where [jcr:primaryType] = 'nt:base' in(*)([jcr:primaryType] = 'nt:base', 'nt:base') union select [jcr:path], [jcr:score], * from [nt:base] as a where [jcr:primaryType] = 'nt:base' /* xpath: //*[(@jcr:primaryType = 'nt:base' or @jcr:primaryType = 'nt:base' or @jcr:primaryType = 'nt:base' or @jcr:primaryType = 'nt:base')] */; expected: <end>
      
      	at org.apache.jackrabbit.oak.query.SQL2Parser.getSyntaxError(SQL2Parser.java:1357)
      	at org.apache.jackrabbit.oak.query.SQL2Parser.parse(SQL2Parser.java:163)
      	at org.apache.jackrabbit.oak.query.SQL2Parser.parse(SQL2Parser.java:191)
      	at org.apache.jackrabbit.oak.query.SQL2ParserTest.testTransformAndParse(SQL2ParserTest.java:56)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      

      Work-around: set -Doak.xpathNodeTypeUnion=false on jvm command line.

      Attachments

        Issue Links

          Activity

            People

              thomasm Thomas Mueller
              catholicon Vikas Saurabh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: