From f3aaf7f973943a01d96ef088af962caad7350d73 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Tue, 28 Mar 2023 10:57:40 +0800 Subject: [PATCH] fix path equal --- src/common/datatypes/Path.h | 4 ++-- tests/tck/features/match/Path.feature | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/common/datatypes/Path.h b/src/common/datatypes/Path.h index cfc9c07c629..f5a5b281a8f 100644 --- a/src/common/datatypes/Path.h +++ b/src/common/datatypes/Path.h @@ -79,8 +79,8 @@ struct Step { } bool operator==(const Step& rhs) const { - return dst == rhs.dst && type == rhs.type && name == rhs.name && ranking == rhs.ranking && - props == rhs.props; + return dst == rhs.dst && (type == rhs.type || type == -rhs.type) && name == rhs.name && + ranking == rhs.ranking && props == rhs.props; } bool operator<(const Step& rhs) const { diff --git a/tests/tck/features/match/Path.feature b/tests/tck/features/match/Path.feature index f298b04f234..4dfd065f44a 100644 --- a/tests/tck/features/match/Path.feature +++ b/tests/tck/features/match/Path.feature @@ -37,6 +37,20 @@ Feature: Matching paths Then the result should be, in any order: | count(p) | count(p2) | | 966 | 966 | + When executing query: + """ + match p = (v:Label_5)-[e:Rel_0]->(v1:Label_1), + p2 = (v)<-[e1:Rel_0]-(v1) + where id(v) == 47 + and p != p2 + and e == e1 + and v == v + and v1 == v1 + return count(*) + """ + Then the result should be, in any order: + | count(*) | + | 0 | # The correctness of the following test cases needs to be verified, mark it @skip for now @skip