@FixFor( "MODE-2494" )
@Test
public void shouldBeAbleToCreateAndExecuteJcrSql2QueryWithTwoLeftOuterJoinsOnIsChildNodeWithSubsequentIsChildNode() throws RepositoryException {

    String sql = "SELECT parent.[jcr:path], child1.[jcr:name], desc.[jcr:name] FROM [nt:unstructured] AS parent " +
            "LEFT OUTER JOIN [nt:unstructured] AS child1 ON ISCHILDNODE(child1,parent) " +
            "INNER JOIN [nt:unstructured] AS desc on ISCHILDNODE(desc, child1) " +
            "LEFT OUTER JOIN [nt:unstructured] AS child2 ON ISCHILDNODE(child2,parent) " +
            "WHERE ISCHILDNODE(parent,'/') " +
            "AND NAME(child2) = 'Hybrid' " +
            "AND NAME(desc) LIKE 'Nissan%'";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
    QueryResult result = query.execute();
    validateQuery().rowCount(1).validate(query, result);
}