Skip to content

Commit

Permalink
Merge branch 'master' into fix-unconnected-component-in-graph
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Mar 3, 2025
2 parents 21c2e61 + 01f91a6 commit 27c14b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/upload-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
env:
compiler: clang
compiler-version: 16
warnings: "-Wall -Wextra "
warnings: "-Wall -Wextra "
build-type: Release
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
Expand Down Expand Up @@ -132,11 +132,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output=build_wrapper_output_directory -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} -Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} -Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
sonar-scanner --define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} -Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} -Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
- name: SonarCloud Scan on push
if: github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.event.repository.full_name
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output=build_wrapper_output_directory -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
sonar-scanner --define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion src/engine/QueryPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::optimize(
if (candidatePlans.at(0).empty()) {
// This happens if either graph pattern is an empty group,
// or it only consists of a MINUS clause (which then has no effect).
return {makeSubtreePlan<NeutralElementOperation>(_qec)};
std::vector neutralPlans{makeSubtreePlan<NeutralElementOperation>(_qec)};
// Neutral element can potentially still get filtered out
applyFiltersIfPossible<true>(neutralPlans, rootPattern->_filters);
return neutralPlans;
}
return candidatePlans[0];
}
Expand Down
12 changes: 12 additions & 0 deletions test/QueryPlannerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,18 @@ TEST(QueryPlanner, Exists) {
filter);
}

// _____________________________________________________________________________
TEST(QueryPlanner, FilterOnNeutralElement) {
h::expect("SELECT * { FILTER(false) }",
h::Filter("false", h::NeutralElement()));
h::expect("SELECT * { FILTER(true) }",
h::Filter("true", h::NeutralElement()));

h::expect("SELECT * { { SELECT * WHERE { FILTER(false) } } VALUES ?x { 1 } }",
h::CartesianProductJoin(h::Filter("false", h::NeutralElement()),
h::ValuesClause("VALUES (?x) { (1) }")));
}

// _____________________________________________________________________________
TEST(QueryPlanner, ContainsWordInGraphClause) {
{
Expand Down

0 comments on commit 27c14b3

Please sign in to comment.