Skip to content

[CYPHER] Variable-length pattern *0..0 in list comprehension returns wrong nodes #3929

Description

@ExtReMLapin

Test: variableLengthPatternComprehensionZeroLength (line 361)

Setup (create test data):

CREATE (alice:VarLengthTest {name:'Alice'}), 
       (bob:VarLengthTest {name:'Bob'}), 
       (charlie:VarLengthTest {name:'Charlie'}), 
       (alice)-[:KNOWS]->(bob), 
       (bob)-[:KNOWS]->(charlie), 
       (alice)-[:KNOWS]->(charlie)

Cypher query to execute:

MATCH (a:VarLengthTest {name:'Alice'}) RETURN [(a)-[:KNOWS*0..0]->(f:VarLengthTest) | f.name] AS result

Expected behavior:

[(a)-[:KNOWS*0..0]->(f) | f.name] where a is 'Alice' should return ['Alice']

ArcadeDB result:

{"result": ["Charlie", "Bob"]}

Neo4j result:

{"result": ["Alice"]}

A zero-length variable-length pattern should return the anchor node itself, but it returns other nodes instead.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions