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 "Alex Parvulescu (JIRA)" <ji...@apache.org> on 2013/05/20 11:29:16 UTC
[jira] [Comment Edited] (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=13661854#comment-13661854 ]
Alex Parvulescu edited comment on OAK-830 at 5/20/13 9:27 AM:
--------------------------------------------------------------
better fix with rev 1484404.
edit: (replaced the previous fix from rev 1484393).
was (Author: alex.parvulescu):
fixed with rev 1484393.
if there are more than 2 conditions there can be some excessive wrapping (ie. _((b.[type] = 't1' or b.[type] = 't2') or b.[type] = 't3')_) but that is better than no brackets at all.
> 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: Alex Parvulescu
> 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