garlik/4store — pull request #47 by msalvadores (2011-12-01 01:28:19+00:00)
Title: patch for queries with UNION on different subjects and FILTER on predicate variable.

Some details to be able to reproduce the bug that this patch fixes ...

@prefix : .
@prefix def: .

:termC def:zzzz "termC zzzz" .
:termD def:yyyy "termD zzzz" .

And the following query that doen't make much sense, it is just to reflect the bug ...

SELECT * WHERE {
{ ?p ?o . }
UNION
{ ?p ?o . }
FILTER (?p = ||
?p = )
}

This query should return the two triples in the store but returns just one. It seems we have an issue with query-backend.c that I have fixed.

This patch touches a sensible part of the backend component so it might be good that someone else looks at this carefully. Steve, you might be able to find a better patch by touching the query engine ... I could not find the issue there.

Manuel