Fix using path identifier after CREATE (#1629)
This commit is contained in:
parent
1ba2f4e619
commit
d4bcdb77ad
@ -1,4 +1,4 @@
|
||||
// Copyright 2023 Memgraph Ltd.
|
||||
// Copyright 2024 Memgraph Ltd.
|
||||
//
|
||||
// Use of this software is governed by the Business Source License
|
||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||
@ -380,6 +380,7 @@ class RuleBasedPlanner {
|
||||
if (pattern.identifier_->user_declared_) {
|
||||
std::vector<Symbol> path_elements;
|
||||
for (const PatternAtom *atom : pattern.atoms_) path_elements.emplace_back(symbol_table.at(*atom->identifier_));
|
||||
bound_symbols.insert(symbol_table.at(*pattern.identifier_));
|
||||
last_op = std::make_unique<ConstructNamedPath>(std::move(last_op), symbol_table.at(*pattern.identifier_),
|
||||
path_elements);
|
||||
}
|
||||
|
@ -771,3 +771,17 @@ Feature: Match
|
||||
Then the result should be:
|
||||
| path |
|
||||
| <(:label1 {id: 1})-[:type1 {id: 1}]->(:label2 {id: 2})-[:type1 {id: 2}]->(:label3 {id: 3})> |
|
||||
|
||||
Scenario: Using path indentifier from CREATE in MERGE
|
||||
Given an empty graph
|
||||
And having executed:
|
||||
"""
|
||||
CREATE p0=()-[:T0]->() MERGE ({k:(size(p0))});
|
||||
"""
|
||||
When executing query:
|
||||
"""
|
||||
MATCH (n {k: 1}) RETURN n;
|
||||
"""
|
||||
Then the result should be:
|
||||
| n |
|
||||
| ({k: 1}) |
|
||||
|
Loading…
Reference in New Issue
Block a user