Alex Parvulescu created OAK-830:
-----------------------------------
Summary: 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
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