[jira] Created: (JCR-1688) Query parser builds invalid parse tree

View: New views
5 Messages — Rating Filter:   Alert me  

[jira] Created: (JCR-1688) Query parser builds invalid parse tree

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Query parser builds invalid parse tree
--------------------------------------

                 Key: JCR-1688
                 URL: https://issues.apache.org/jira/browse/JCR-1688
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-spi-commons
            Reporter: Michael Dürig
            Priority: Minor


Calling org.apache.jackrabbit.spi.commons.query.QueryParser.parse on

SELECT prop1 FROM nt:unstructured WHERE prop1 IS NOT NULL ORDER BY prop1 ASC

results in the following parse tree

+ Select properties: {}prop1
 + PathQueryNode
   + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
     + RelationQueryNode: Op: NOT NULL Prop=@{}prop1 Type=STRING Value=%
     + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
 + OrderQueryNode
   {}prop1 asc=true

The RelationQueryNode should not have a second operand since the NOT NULL operator is unary.



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1688) Query parser builds invalid parse tree

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/JCR-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615927#action_12615927 ]

Michael Dürig commented on JCR-1688:
------------------------------------

Another query which creates a bad parse tree:

SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'

results in

+ Select properties: *
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest={} Descendants=false Index=NONE
    + LocationStepQueryNode:  NodeTest=* Descendants=false Index=NONE
      + AndQueryNode
        + NotQueryNode

Note the AndQueryNode having a single operand and the NotQueryNode having no operand at all.

> Query parser builds invalid parse tree
> --------------------------------------
>
>                 Key: JCR-1688
>                 URL: https://issues.apache.org/jira/browse/JCR-1688
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling org.apache.jackrabbit.spi.commons.query.QueryParser.parse on
> SELECT prop1 FROM nt:unstructured WHERE prop1 IS NOT NULL ORDER BY prop1 ASC
> results in the following parse tree
> + Select properties: {}prop1
>  + PathQueryNode
>    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
>      + RelationQueryNode: Op: NOT NULL Prop=@{}prop1 Type=STRING Value=%
>      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
>  + OrderQueryNode
>    {}prop1 asc=true
> The RelationQueryNode should not have a second operand since the NOT NULL operator is unary.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1688) Query parser builds invalid parse tree

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/JCR-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615935#action_12615935 ]

Marcel Reutegger commented on JCR-1688:
---------------------------------------

Fixed the first issue in revision: 679054

> Query parser builds invalid parse tree
> --------------------------------------
>
>                 Key: JCR-1688
>                 URL: https://issues.apache.org/jira/browse/JCR-1688
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling org.apache.jackrabbit.spi.commons.query.QueryParser.parse on
> SELECT prop1 FROM nt:unstructured WHERE prop1 IS NOT NULL ORDER BY prop1 ASC
> results in the following parse tree
> + Select properties: {}prop1
>  + PathQueryNode
>    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
>      + RelationQueryNode: Op: NOT NULL Prop=@{}prop1 Type=STRING Value=%
>      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
>  + OrderQueryNode
>    {}prop1 asc=true
> The RelationQueryNode should not have a second operand since the NOT NULL operator is unary.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1688) Query parser builds invalid parse tree

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JCR-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-1688.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

Also fixed second issue. svn revision: 679093

Thank you for reporting this issue.

> Query parser builds invalid parse tree
> --------------------------------------
>
>                 Key: JCR-1688
>                 URL: https://issues.apache.org/jira/browse/JCR-1688
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>            Reporter: Michael Dürig
>            Priority: Minor
>             Fix For: 1.5
>
>
> Calling org.apache.jackrabbit.spi.commons.query.QueryParser.parse on
> SELECT prop1 FROM nt:unstructured WHERE prop1 IS NOT NULL ORDER BY prop1 ASC
> results in the following parse tree
> + Select properties: {}prop1
>  + PathQueryNode
>    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
>      + RelationQueryNode: Op: NOT NULL Prop=@{}prop1 Type=STRING Value=%
>      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
>  + OrderQueryNode
>    {}prop1 asc=true
> The RelationQueryNode should not have a second operand since the NOT NULL operator is unary.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (JCR-1688) Query parser builds invalid parse tree

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JCR-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig closed JCR-1688.
------------------------------


Works great, thanks.

> Query parser builds invalid parse tree
> --------------------------------------
>
>                 Key: JCR-1688
>                 URL: https://issues.apache.org/jira/browse/JCR-1688
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>            Reporter: Michael Dürig
>            Priority: Minor
>             Fix For: 1.5
>
>
> Calling org.apache.jackrabbit.spi.commons.query.QueryParser.parse on
> SELECT prop1 FROM nt:unstructured WHERE prop1 IS NOT NULL ORDER BY prop1 ASC
> results in the following parse tree
> + Select properties: {}prop1
>  + PathQueryNode
>    + LocationStepQueryNode:  NodeTest=* Descendants=true Index=NONE
>      + RelationQueryNode: Op: NOT NULL Prop=@{}prop1 Type=STRING Value=%
>      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
>  + OrderQueryNode
>    {}prop1 asc=true
> The RelationQueryNode should not have a second operand since the NOT NULL operator is unary.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

LightInTheBox - Buy quality products at wholesale price