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

Problem with a logical expression #12029

Closed
hakami1024 opened this issue Sep 4, 2018 · 4 comments
Closed

Problem with a logical expression #12029

hakami1024 opened this issue Sep 4, 2018 · 4 comments

Comments

@hakami1024
Copy link

hakami1024 commented Sep 4, 2018

I'm running the following query:

RETURN
(
  (
    (
      7414 IN [7372, 7414]
    ) 
    AND 
    (
       67542.0 <= 64547.0
    )
  ) 
  OR 
  (
    (
      7414 IN [7371, 7368, 7413, 7410] 
    )
    AND 
    (
       67542.0 <= 4061660.0
    )
  )
);

On

  • Neo4j version: 3.1.3
  • Operating system: Ubuntu 16.04
  • Connecting through [http://localhost:7474/browser/]
    it returns false. That looks OK.

But!
On

  • Neo4j version: 3.4.7
  • Operating system: ArchLinux
  • Connecting through [http://localhost:7474/browser/]
    it returns true.

This bunch of numbers is a heavily reduced part of my match-where query, which matched more nodes than expected.

Is this a bug? Or am I just missing something about the Cypher's syntax?

@hakami1024
Copy link
Author

Neo4j version: 3.4.1
Operating system: Ubuntu 16.04
Connecting through [http://localhost:7474/browser/]
-- also true

@hakami1024
Copy link
Author

RETURN
(
  (
    (
      7414 IN [7372, 7414]
    ) 
    AND 
    (
       67542.0 <= 64547.0
    )
  ) 
  OR 
  (
    (
      7414 IN [7371, 7368, 7413, 7410] 
    )
    AND 
    (
       67542.0 <= 4061660.0
    )
  )
),

(
  (
    7414 IN [7372, 7414]
  ) 
  AND 
  (
      67542.0 <= 64547.0
  )
),

(
  7414 IN [7371, 7368, 7413, 7410] 
)
AND 
(
  67542.0 <= 4061660.0
),

false OR false;

-- true, false, false, false on 3.4.7

And on v. 3.3.2 no problem.

@SaschaPeukert
Copy link
Contributor

Hej @hakami1024 ,

Thanks for reporting this. We will take a look!

Cheers,
Sascha

Neo4j Cypher Team

@hdk
Copy link

hdk commented Sep 4, 2018

even shorter (in 3.4.0 and 3.4.7):

return ( ( "a" IN ["a", "b"] ) AND false ) OR ( "X" IN ["c", "d"] ) ;
=> false

return ( ( "a" IN ["a", "b"] ) AND false ) OR ( "a" IN ["c", "d"] ) ;
=> true

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