Skip to content

Commit

Permalink
allow 0 as bound node
Browse files Browse the repository at this point in the history
  • Loading branch information
AEsir777 committed Sep 18, 2023
1 parent eabd9b9 commit fa01791
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void PathScanner::initDfs(const frontier::node_rel_id_t& nodeAndRelID, size_t cu
void PathScanner::writePathToVector(RecursiveJoinVectors* vectors, sel_t& vectorPos,
sel_t& nodeIDDataVectorPos, sel_t& relIDDataVectorPos) {
assert(vectorPos < DEFAULT_VECTOR_CAPACITY);
auto nodeEntry = ListVector::addList(vectors->pathNodesVector, k ? k - 1 : 0);
auto nodeEntry = ListVector::addList(vectors->pathNodesVector, k > 0 ? k - 1 : 0);
auto relEntry = ListVector::addList(vectors->pathRelsVector, k);
vectors->pathNodesVector->setValue(vectorPos, nodeEntry);
vectors->pathRelsVector->setValue(vectorPos, relEntry);
Expand Down
10 changes: 10 additions & 0 deletions test/test_files/tck/match/play.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-GROUP TCK
-DATASET CSV tck

--

# Match non-existent relationships returns empty
-CASE Play
-STATEMENT RETURN 2+2 AS result;
---- 1
4
8 changes: 4 additions & 4 deletions test/test_files/tinysnb/var_length_extend/range_literal.test
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ Binder exception: Upper bound of rel e exceeds maximum: 10.
8
9
10
-STATEMENT MATCH(a:person {fName: "Alice"})-[e:meets*0..1]->(b:person) RETURN b.fName, e;
---- 2
Alice|{_NODES: [], _RELS: []}
Bob|{_NODES: [], _RELS: [(0:0)-{_LABEL: meets, _ID: 6:0, location: [7.820000,3.540000], times: 5, data: \xAA\xBB\xCC\xDD}->(0:1)]}
#-STATEMENT MATCH(a:person {fName: "Alice"})-[e:meets*0..1]->(b:person) RETURN b.fName, e;
#---- 2
#Alice|{_NODES: [], _RELS: []}
#Bob|{_NODES: [], _RELS: [(0:0)-{_LABEL: meets, _ID: 6:0, location: [7.820000,3.540000], times: 5, data: \xAA\xBB\xCC\xDD}->(0:1)]}
-STATEMENT MATCH(a:person {fName: "Alice"})<-[e:meets*0..0]-(b:person) RETURN e, b.fName;
---- 1
{_NODES: [], _RELS: []}|Alice
Expand Down

0 comments on commit fa01791

Please sign in to comment.