From d0b8fe1a23315b2eac0c2fe48fa65db6fa215a04 Mon Sep 17 00:00:00 2001 From: Tpt Date: Thu, 24 Feb 2022 21:37:14 +0100 Subject: [PATCH] SPARQL: there should be no group if there is no solution in a GROUP BY See #189 --- lib/src/sparql/eval.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/src/sparql/eval.rs b/lib/src/sparql/eval.rs index e119ee5b..4a3fbfa0 100644 --- a/lib/src/sparql/eval.rs +++ b/lib/src/sparql/eval.rs @@ -616,10 +616,9 @@ impl SimpleEvaluator { ); } }); - if accumulators_for_group.is_empty() { - // There is always at least one group - accumulators_for_group - .insert(vec![None; key_mapping.len()], Vec::default()); + if accumulators_for_group.is_empty() && key_mapping.is_empty() { + // There is always a single group if there is no GROUP BY + accumulators_for_group.insert(Vec::new(), Vec::new()); } let accumulator_variables = accumulator_variables.clone(); Box::new(