Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Mar 28, 2023
1 parent d76223a commit 0804c33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/graph/validator/MatchValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,12 @@ Status MatchValidator::buildNodeInfo(const MatchPath *path,
} else {
// an node alias generated here can be repeated.
// but it cannot be the same with any previously defined ones.
if (aliases.find(alias.c_str()) != aliases.end()) {
return Status::SemanticError("`%s`: alias redefined", alias.c_str());
auto iter = aliases.find(alias.c_str());
if (iter != aliases.end()) {
if (iter->second != AliasType::kNode) {
return Status::SemanticError("`%s`: alias redefined with a different type",
alias.c_str());
}
}
nodeAliases.emplace(alias, AliasType::kNode);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/features/match/Path.feature
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Feature: Matching paths
where id(v) in [100] and id(v3) in [80]
return count(p), count(p2)
"""
Then a SemanticError should be raised at runtime: `p': alias redefined
Then a SemanticError should be raised at runtime: `p': alias redefined with a different type

Scenario: use of defined vertices
# edges cannot be redefined, tested in Scenario: distinct edges and paths
Expand Down

0 comments on commit 0804c33

Please sign in to comment.