Fixes LATERAL inside of OPTIONAL behavior

lateral
Tpt 2 years ago
parent 2d7eac932f
commit e922d3293b
  1. 3
      lib/src/sparql/plan_builder.rs
  2. 15
      testsuite/oxigraph-tests/sparql/lateral/subselect_inside_optional.srx

@ -1128,10 +1128,9 @@ impl<'a> PlanBuilder<'a> {
} => {
let mut child_problematic_set = BTreeSet::new();
for (child_i, output_i) in lateral_mapping.iter() {
if set.contains(output_i) {
set.insert(*output_i);
child_problematic_set.insert(*child_i);
}
}
Self::add_left_join_problematic_variables(child, &mut child_problematic_set);
for (child_i, output_i) in mapping.iter() {
if child_problematic_set.contains(child_i) {

@ -26,7 +26,7 @@
<uri>http://example.org/s2</uri>
</binding>
<binding name="o">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">21</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">11</literal>
</binding>
</result>
<result>
@ -34,13 +34,24 @@
<uri>http://example.org/s2</uri>
</binding>
<binding name="o">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">22</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">11</literal>
</binding>
</result>
<result>
<binding name="s">
<uri>http://example.org/s3</uri>
</binding>
<binding name="o">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">11</literal>
</binding>
</result>
<result>
<binding name="s">
<uri>http://example.org/s3</uri>
</binding>
<binding name="o">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">11</literal>
</binding>
</result>
</results>
</sparql>
Loading…
Cancel
Save