[ https://issues.apache.org/jira/browse/JCR-2933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014481#comment-13014481 ]
Thomas Mueller commented on JCR-2933: ------------------------------------- I'm not sure if the proposed solution always works, specially for 3+ way joins. I think there should be a randomized test case that compares the result with a relational database. I wrote such a test case, it could be adapted to SQL2: http://code.google.com/p/h2database/source/browse/trunk/h2/src/test/org/h2/test/synth/TestNestedJoins.java - this test case found quite a lot of problems, including problems in Apache Derby: DERBY-4712 - therefore it probably makes sense to run the test against other databases as well. I think the most stable database is PostgreSQL, but we can't include it in our unit tests. Therefore, I would pick H2 and Apache Derby (meaning run the test against Jackrabbit, H2, Derby, and compare the results). > SQL2 Left Outer Join > -------------------- > > Key: JCR-2933 > URL: https://issues.apache.org/jira/browse/JCR-2933 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: 2.2.4 > Reporter: Manfred Sattler > Assignee: Jukka Zitting > Attachments: JCR-2933-v2.patch, JCR-2933-v3.patch, JCR-2933.patch > > > Create this nodes. > def n1 = root.addNode("node1", "sling:SamplePage"); > n1.setProperty("n1prop1", "page1"); > def n2 = n1.addNode("node2", "sling:SampleContent"); > n2.setProperty("n2prop1", "content1"); > Execute this Query: > Select * from [sling:SamplePage] as page left outer join > [sling:SampleContent] as content on ISDESCENDANTNODE(content,page) where > page.n1prop1 = 'page1' and content.n2prop1 = 'content1'; > The resultset have 1 row with 2 Nodes. This OK. > Then execute this: > Select * from [sling:SamplePage] as page left outer join > [sling:SampleContent] as content on ISDESCENDANTNODE(content,page) where > page.n1prop1 = 'page1' and content.n2prop1 = 'XXXXX'; > The resultset has 1 row with 1 node. > This wrong. The result should be 0 rows. > Old Versions, prior 2.2.2 have also 0 rows as result. > Also, if nodes "n2" not exists, jackrabbit reports 1 row as result. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira