Fix a crash caused by declaring a path with only one node in OPTIONAL MATCH clause (#1318)
This commit is contained in:
parent
3143c986de
commit
0d51a20a02
@ -488,6 +488,10 @@ class RuleBasedPlanner {
|
||||
last_op = std::make_unique<ScanAll>(std::move(last_op), node1_symbol, view);
|
||||
new_symbols.emplace_back(node1_symbol);
|
||||
|
||||
last_op = GenFilters(std::move(last_op), bound_symbols, filters, storage, symbol_table);
|
||||
last_op = impl::GenNamedPaths(std::move(last_op), bound_symbols, named_paths);
|
||||
last_op = GenFilters(std::move(last_op), bound_symbols, filters, storage, symbol_table);
|
||||
} else if (named_paths.size() == 1U) {
|
||||
last_op = GenFilters(std::move(last_op), bound_symbols, filters, storage, symbol_table);
|
||||
last_op = impl::GenNamedPaths(std::move(last_op), bound_symbols, named_paths);
|
||||
last_op = GenFilters(std::move(last_op), bound_symbols, filters, storage, symbol_table);
|
||||
|
@ -323,3 +323,16 @@ Feature: OptionalMatchAcceptance
|
||||
| a | b |
|
||||
| [] | [42, 43, 44] |
|
||||
And no side effects
|
||||
|
||||
Scenario: Declaring a path with only one node in OPTIONAL MATCH after MATCH in which that node is already used
|
||||
When executing query:
|
||||
"""
|
||||
MATCH (n1) OPTIONAL MATCH p=(n1) RETURN p;
|
||||
"""
|
||||
Then the result should be:
|
||||
| p |
|
||||
| <(:Single)> |
|
||||
| <(:A {prop: 42})> |
|
||||
| <(:B {prop: 46})> |
|
||||
| <(:C)> |
|
||||
And no side effects
|
||||
|
Loading…
Reference in New Issue
Block a user