Skip to content

Commit

Permalink
Merge pull request #1938 from kuzudb/disable-undirected-delete
Browse files Browse the repository at this point in the history
Disable undirected delete
  • Loading branch information
ray6080 committed Aug 16, 2023
2 parents da8107c + 5ad5f98 commit 62a4ac6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
4 changes: 4 additions & 0 deletions src/binder/bind/bind_updating_clause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ std::unique_ptr<BoundUpdatingClause> Binder::bindDeleteClause(
boundDeleteClause->addInfo(std::move(deleteNodeInfo));
} break;
case LogicalTypeID::REL: {
auto rel = (RelExpression*)nodeOrRel.get();
if (rel->getDirectionType() == RelDirectionType::BOTH) {
throw BinderException("Delete undirected rel is not supported.");
}
auto deleteRel = std::make_unique<BoundDeleteInfo>(UpdateTableType::REL, nodeOrRel);
boundDeleteClause->addInfo(std::move(deleteRel));
} break;
Expand Down
20 changes: 4 additions & 16 deletions test/test_files/tinysnb/update_rel/delete.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@
0|3|3:1
0|5|3:2

# TODO: fix this case, it fails ASAN
#-CASE DeleteRelMultiLabel3
#-STATEMENT MATCH (a)-[e]-(b) WHERE a.ID = 0 RETURN a.ID, b.ID, id(e)
#---- 9
#0|1|4:0
#0|2|3:0
#0|2|3:3
#0|2|6:0
#0|2|7:0
#0|3|3:1
#0|3|3:6
#0|5|3:2
#0|5|3:9
#-STATEMENT MATCH (a)-[e]-(b) WHERE a.ID = 0 AND b.ID = 2 DELETE e
#-PARALLELISM 1
#---- ok

-STATEMENT MATCH (a)-[e]-(b) WHERE a.ID = 0 AND b.ID = 2 DELETE e
---- error
Binder exception: Delete undirected rel is not supported.

0 comments on commit 62a4ac6

Please sign in to comment.