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

Possibly incorrect result with count() on self loops #8324

Closed
pranet opened this issue Nov 8, 2016 · 1 comment
Closed

Possibly incorrect result with count() on self loops #8324

pranet opened this issue Nov 8, 2016 · 1 comment

Comments

@pranet
Copy link

pranet commented Nov 8, 2016

  • Neo4j version: 3.0.4

  • Operating system: El Capitan 10.11.13

  • API/Driver: Cypher

  • Steps to reproduce
    Create a graph using the following commands:
    create (n)-[r:CALL]->(n)
    create (n)-[r:CALL]->(n)
    create (u)-[r:CALL]->(v)

(Total 4 nodes, with 2 self loops, and one more edge)

Query A:
match(n)-[r:CALL]->(n)
return count(r)

  • Expected behavior
    2
  • Actual behavior
    3

Query B:
match(n)-[r:CALL]->(n)
where id(n) = id(n)
return count(r)

  • Expected behavior
    2
  • Actual behavior
    2

Query C:
match(n)-[r:CALL]->(n)
return r

  • Expected behavior
    2 edges returned
  • Actual behavior
    2 edges returned

Profiling for A gives the following
screen shot 2016-11-08 at 3 55 35 pm

Seems to be completely ignoring the match clause. Query B, and C work as expected however.

@spacecowboy
Copy link
Contributor

I agree. The result for Query A is surprising. Thanks for the report.

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