From 7c2b12c9de22fadf3864f8396172dfac0947471f Mon Sep 17 00:00:00 2001 From: jimingquan <6930445+nevermore3@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:10:50 +0800 Subject: [PATCH] fix allpath without prop when one step --- src/graph/executor/algo/AllPathsExecutor.cpp | 4 ++-- tests/tck/features/path/AllPath.feature | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/graph/executor/algo/AllPathsExecutor.cpp b/src/graph/executor/algo/AllPathsExecutor.cpp index d5f1f9d5439..aa4422e089e 100644 --- a/src/graph/executor/algo/AllPathsExecutor.cpp +++ b/src/graph/executor/algo/AllPathsExecutor.cpp @@ -457,8 +457,8 @@ void AllPathsExecutor::buildOneWayPath(std::vector& paths, bool reverse) auto iter = emptyPropVertices_.find(emptyPropVertex); if (iter == emptyPropVertices_.end()) { emptyPropVids_.emplace_back(dst); - emptyPropVertices_.emplace(emptyPropVertex); } + emptyPropVertices_.emplace(emptyPropVertex); result_.rows.emplace_back(std::move(row)); } } @@ -506,8 +506,8 @@ std::vector AllPathsExecutor::buildOneWayPathFromHashTable(bool reverse) { auto iter = emptyPropVertices_.find(emptyPropVertex); if (iter == emptyPropVertices_.end()) { emptyPropVids_.emplace_back(vid); - emptyPropVertices_.emplace(emptyPropVertex); } + emptyPropVertices_.emplace(emptyPropVertex); } return result; } diff --git a/tests/tck/features/path/AllPath.feature b/tests/tck/features/path/AllPath.feature index 596f8709b5d..cc9a8184cb2 100644 --- a/tests/tck/features/path/AllPath.feature +++ b/tests/tck/features/path/AllPath.feature @@ -371,6 +371,14 @@ Feature: All Path | <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> | | <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"})-[:like@0 {likeness: 90}]->("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> | | <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})-[:like@0 {likeness: 90}]->("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"})-[:like@0 {likeness: 75}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> | + When executing query: + """ + FIND ALL PATH WITH PROP FROM "Tim Duncan" TO "Tony Parker" OVER * UPTO 1 STEPS YIELD path as p + """ + Then the result should be, in any order, with relax comparison: + | p | + | <("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> | + | <("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"})-[:teammate@0 {end_year: 2016, start_year: 2001}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> | Scenario: ALL Path constant filter When executing query: