diff --git a/src/graph/validator/MatchValidator.cpp b/src/graph/validator/MatchValidator.cpp index 8a359b7f2f1..cdd21da44b8 100644 --- a/src/graph/validator/MatchValidator.cpp +++ b/src/graph/validator/MatchValidator.cpp @@ -380,6 +380,12 @@ Status MatchValidator::buildColumnsForAllNamedAliases(const std::vector(boundary.get()); columns->addColumn(makeColumn(unwindCtx->alias), true); + for (auto &passAlias : prevQueryPart.aliasesAvailable) { + columns->addColumn(makeColumn(passAlias.first), true); + } + for (auto &passAlias : prevQueryPart.aliasesGenerated) { + columns->addColumn(makeColumn(passAlias.first), true); + } break; } case CypherClauseKind::kWith: { diff --git a/tests/tck/features/match/With.feature b/tests/tck/features/match/With.feature index 7637c5b374f..a1749bbb444 100644 --- a/tests/tck/features/match/With.feature +++ b/tests/tck/features/match/With.feature @@ -413,3 +413,34 @@ Feature: With clause return count (p) """ Then a SemanticError should be raised at runtime: Alias used but not defined: `p' + + Scenario: with wildcard after unwind before argument + When executing query: + """ + match (v:player)--(t:team) + where id(v) == "Tim Duncan" + unwind [1] as digit + with * + match (t:team)<--(v1) + return v1.player.name + """ + Then the result should be, in any order: + | v1.player.name | + | "Cory Joseph" | + | "Kyle Anderson" | + | "Danny Green" | + | "David West" | + | "Jonathon Simmons" | + | "LaMarcus Aldridge" | + | "Rudy Gay" | + | "Tony Parker" | + | "Marco Belinelli" | + | "Marco Belinelli" | + | "Tiago Splitter" | + | "Tim Duncan" | + | "Manu Ginobili" | + | "Tracy McGrady" | + | "Boris Diaw" | + | "Aron Baynes" | + | "Paul Gasol" | + | "Dejounte Murray" |