You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2013/05/21 11:29:17 UTC

[jira] [Commented] (OAK-830) XPathToSQL2Converter fails to wrap or clauses

    [ https://issues.apache.org/jira/browse/OAK-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13662839#comment-13662839 ] 

Thomas Mueller commented on OAK-830:
------------------------------------

Fixed in revision 1484714 (also includes test cases)
                
> XPathToSQL2Converter fails to wrap or clauses
> ---------------------------------------------
>
>                 Key: OAK-830
>                 URL: https://issues.apache.org/jira/browse/OAK-830
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: Alex Parvulescu
>            Assignee: Thomas Mueller
>             Fix For: 0.8
>
>
> There are some xpath queries that contain some 'or' clauses which are not properly converted to sql2:
> For example
> {code}
> /jcr:root/home//test/* [@type='t1' or @type='t2' or @type='t3']
> {code}
> turns into 
> {code}
> select b.[jcr:path] as [jcr:path], b.[jcr:score] as [jcr:score], b.* from [nt:base] as a inner join [nt:base] as b on ischildnode(b, a) where (name(a) = 'test' and isdescendantnode(a, '/home')) and b.[type] = 't1' or b.[type] = 't2') or b.[type] = 't3' /* xpath: /jcr:root/home//test/* [@type='t1' or @type='t2' or @type='t3'] */
> {code}
> Notice how the 3 'or's should be wrapped into parenthesis, otherwise the resulting query is simply wrong.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira