Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypher query returning nodes it shouldn't on 2.2.1 #4542

Closed
ricardojmendez opened this issue Apr 28, 2015 · 1 comment
Closed

Cypher query returning nodes it shouldn't on 2.2.1 #4542

ricardojmendez opened this issue Apr 28, 2015 · 1 comment

Comments

@ricardojmendez
Copy link

Hi,

I've tried this against several 2.2.x installs, including the recent 2.2.1 docker container.

For the following Geoff data:

(n1) {"code":"TestNode/N1"}
(n2) {"code":"TestNode/N2"}
(n3) {"code":"TestNode/N3"}
(n4) {"code":"TestNode/N4"}
(n5) {"code":"TestNode/N5"}
(n6) {"code":"TestNode/N6"}
(n7) {"code":"TestNode/N7"}
(n8) {"code":"TestNode/N8"}
(n9) {"code":"TestNode/N9"}
(n1)-[:LINKSTO]->(n2)
(n1)-[:LINKSTO]->(n3)
(n1)-[:LINKSTO]->(n5)
(n1)-[:LINKSTO]->(n7)
(n2)-[:LINKSTO]->(n3)
(n2)-[:LINKSTO]->(n4)
(n3)-[:LINKSTO]->(n4)
(n3)-[:LINKSTO]->(n5)
(n4)-[:LINKSTO]->(n5)
(n4)-[:LINKSTO]->(n7)
(n6)-[:LINKSTO]->(n7)
(n8)-[:LINKSTO]->(n9)
(n1)-[:DIFFREL]->(n4)
(n1)-[:DIFFREL]->(n3)
(n3)-[:DIFFREL]->(n4)

This query:

MATCH (a {code:"TestNode/N1"})-[:LINKSTO]-b WITH  collect(DISTINCT b) as coll 
UNWIND coll as b1 
UNWIND coll as b2 
MATCH b1-[:LINKSTO]->b2 RETURN DISTINCT b1.code, b2.code;

Should return the following pairs:

[TestNode/N2, TestNode/N3]
[TestNode/N3, TestNode/N5]

Instead it returns

[TestNode/N2, TestNode/N3]
[TestNode/N3, TestNode/N5]
[TestNode/N3, TestNode/N2]
[TestNode/N5, TestNode/N3]

The query works as expected when testing against a 2.1.2 install.

Results are also different on console.neo4j.org: http://console.neo4j.org/r/hv9nyb That response will include N4 and N6, which aren't among the list of nodes that N1 is related to with relationship :LINKSTO, so they should not be among "b".

@ricardojmendez ricardojmendez changed the title Query returning nodes it shouldn't on 2.2.1 Cypher query returning nodes it shouldn't on 2.2.1 May 1, 2015
@jexp
Copy link
Member

jexp commented Jan 6, 2016

Works in 2.2.x and 2.3.x

@jexp jexp closed this as completed Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants