Wrong match results if two variables bind to the same node #564

Closed
BGehrels opened this Issue Feb 27, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@BGehrels
Contributor

BGehrels commented Feb 27, 2013

If my graph looks like this:

(1)-[:L1]->(2)

i would expect

START
    n=node(1),
    m=node(1)
MATCH m-[:L1]->x<-[:L1]-n
RETURN x.name AS x

to return

x = node(2)

Instead, it returns an empty result. This may even be a feature, not a bug, but it should then be explicitly documented somewhere.

But i would propose not to call this a feature: If i would have wanted both edges to differ, i would have added a

rel1 != rel2

condition.

@peterneubauer

This comment has been minimized.

Show comment Hide comment
@peterneubauer

peterneubauer Mar 25, 2013

Contributor

This is a bug, I think we should return an error since you can define nodes explicitely as 2 variables, but cannot have two variables identify the same node in the match patterns, @systay ?

Contributor

peterneubauer commented Mar 25, 2013

This is a bug, I think we should return an error since you can define nodes explicitely as 2 variables, but cannot have two variables identify the same node in the match patterns, @systay ?

@jakewins

This comment has been minimized.

Show comment Hide comment
@jakewins

jakewins Dec 5, 2015

Contributor

Cypher does not allow binding the same node to multiple identifiers, this is an explicit design choice which significantly limits the complexity of writing queries. Cypher today should throw an exception for the query above.

Contributor

jakewins commented Dec 5, 2015

Cypher does not allow binding the same node to multiple identifiers, this is an explicit design choice which significantly limits the complexity of writing queries. Cypher today should throw an exception for the query above.

@jakewins jakewins closed this Dec 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment