History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-642
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Arjohn Kampman
Reporter: Arjohn Kampman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

Query with non-"well designed" optional join produces wrong result

Created: 21/Nov/08 01:50 PM   Updated: 17/Dec/08 02:05 PM
Component/s: Query Engine
Affects Version/s: 2.2.1, 2.1.4, 2.2, 2.1.3, 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0
Fix Version/s: 2.2.2


 Description   
Evaluating this query:

PREFIX : <http://example/>
SELECT DISTINCT *
WHERE {
   ?s1 :p1 ?o .
   {
       optional {
           ?s2 :p2 ?o .
       }
   }
   union
   {
       optional {
           ?s3 :p3 ?o .
       }
   }
}


on the following data:
@prefix : <http://example/> .
:s1 :p1 :o1 .
:s3 :p3 :o1 .

produces results where ?o is not bound, although it is referenced in a non-optional statement pattern.

This is a bug in the query engine, which doesn't process the results coming from the nested optional join correctly.

 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [01/Dec/08 04:23 PM]
The query engine now makes sure that all bindings coming from the parent node are included in the results coming from the "badly designed" left join.