Skip to content

Commit

Permalink
Merge pull request #2977 from kuzudb/issue-2942
Browse files Browse the repository at this point in the history
Fix issue-2942
  • Loading branch information
andyfengHKU committed Mar 1, 2024
2 parents 9e9a492 + 53127c6 commit 820a611
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/expression_evaluator/node_rel_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ void NodeRelExpressionEvaluator::evaluate(ClientContext* clientContext) {
auto internalIDVector = StructVector::getFieldVector(resultVector.get(), internalIDIdx);
for (auto i = 0u; i < resultVector->state->selVector->selectedSize; ++i) {
auto pos = resultVector->state->selVector->selectedPositions[i];
if (internalIDVector->isNull(pos)) {
resultVector->setNull(pos, true);
}
resultVector->setNull(pos, internalIDVector->isNull(pos));
}
}

Expand Down
23 changes: 23 additions & 0 deletions test/test_files/issue/issue.test
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,26 @@ v3|v2
---- 2
1|1
2|1

-CASE 2942

-STATEMENT CREATE NODE TABLE V (id STRING, PRIMARY KEY(id));
---- ok
-STATEMENT CREATE NODE TABLE R (id STRING, PRIMARY KEY(id));
---- ok
-STATEMENT CREATE REL TABLE childof (FROM V TO V);
---- ok
-STATEMENT CREATE REL TABLE relatedto (FROM R TO V);
---- ok
-STATEMENT CREATE (v1:V {id:"v1"}),(v11:V {id:"v11"}),(v12:V {id:"v12"}),(v111:V {id:"v111"}),
(r1:R {id:"r1"}), (r12:R {id:"r12"}),
(v111)-[:childof]->(v11),(v11)-[:childof]->(v1),(v12)-[:childof]->(v1),
(r1)-[:relatedto]->(v1), (r12)-[:relatedto]->(v12);
---- ok
-STATEMENT MATCH (v:V)-[e:childof*]->(v1:V {id: "v1"})
OPTIONAL MATCH (r)-[:relatedto]->(v)
RETURN r, v.id;
---- 3
{_ID: 1:1, _LABEL: R, id: r12}|v12
|v11
|v111

0 comments on commit 820a611

Please sign in to comment.