diff --git a/src/graph/validator/MatchValidator.cpp b/src/graph/validator/MatchValidator.cpp index 3cb3471beb0..3be67e4a2b0 100644 --- a/src/graph/validator/MatchValidator.cpp +++ b/src/graph/validator/MatchValidator.cpp @@ -443,9 +443,6 @@ Status MatchValidator::validateStepRange(const MatchStepRange *range) const { return Status::SemanticError( "Max hop must be greater equal than min hop: %ld vs. %ld", max, min); } - if (max == std::numeric_limits::max()) { - return Status::SemanticError("Cannot set maximum hop for variable length relationships"); - } return Status::OK(); } diff --git a/tests/tck/features/match/ZeroStep.feature b/tests/tck/features/match/ZeroStep.feature index e692b4ed7bc..c85dbb619ef 100644 --- a/tests/tck/features/match/ZeroStep.feature +++ b/tests/tck/features/match/ZeroStep.feature @@ -454,3 +454,40 @@ Feature: Variable length Pattern match (0 step) | [] | ("Trail Blazers" :team{name: "Trail Blazers"}) | | [[:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}]] | ("Trail Blazers" :team{name: "Trail Blazers"}) | | [] | ("Trail Blazers" :team{name: "Trail Blazers"}) | + + Scenario: Multiple variable length with edge filter without max hop number + When executing query: + """ + MATCH p=(v:player{name:"Tim Duncan"})-[e:like*1..]->(v2) + RETURN v2 AS Friends; + """ + Then the result should be, in any order: + | Friends | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | diff --git a/tests/tck/features/match/ZeroStep2.feature b/tests/tck/features/match/ZeroStep2.feature index 25b3478a72a..77907d140b4 100644 --- a/tests/tck/features/match/ZeroStep2.feature +++ b/tests/tck/features/match/ZeroStep2.feature @@ -27,12 +27,6 @@ Feature: test zero steps pattern Then the result should be, in any order, with relax comparison: | e | | [] | - When executing query: - """ - MATCH (v:player{name: 'Tim Duncan'})-[e:like*]-() - RETURN e - """ - Then a SemanticError should be raised at runtime: Cannot set maximum hop for variable length relationships When executing query: """ MATCH (v:player{name: 'Tim Duncan'})-[e:like*0..0]-()-[e2:like*0..0]-() @@ -67,12 +61,6 @@ Feature: test zero steps pattern """ Then the result should be, in any order, with relax comparison: | v | - When executing query: - """ - MATCH (v:player{name: "abc"}) -[:serve*1..]-> () - RETURN * - """ - Then a SemanticError should be raised at runtime: Cannot set maximum hop for variable length relationships Scenario Outline: Single edge with properties in both directions When executing query: