age icon indicating copy to clipboard operation
age copied to clipboard

WITH ignores WHERE condition

Open threedliteguy opened this issue 2 years ago • 2 comments

Describe the bug Using a WHERE after WITH after MATCH ignores condition

How are you accessing AGE (Command line, driver, etc.)? -pgsql inside docker container

What data setup do we need to do? Using the sample city/country data in age/regress/age_load/data/

pgsql

MATCH (m:City) - [:has_city] -> (b:Country{iso2:'BE'}) with b,m where m.name='x' return m.name,b.iso2 $$) as ( "m.name" agtype, "b" agtype);

returns 550 rows

Expected behavior Should return 0 rows due to m.name='x' WHERE condition on WITH

Environment :

  • Version: latest docker image apache/age:latest

Additional info With/Where Ref: https://neo4j.com/docs/cypher-manual/current/clauses/where/

threedliteguy avatar Jul 03 '22 20:07 threedliteguy

We will take a look.

jrgemignani avatar Jul 07 '22 00:07 jrgemignani

I was able to reproduce this on the master branch -

psql-11.5-5432-pgsql=# SELECT * FROM cypher('g', $$ match (u:node) where u.name = 'x' RETURN u.name $$) AS (b agtype);
 b
---
(0 rows)

psql-11.5-5432-pgsql=# SELECT * FROM cypher('g', $$ match (u:node) with u where u.name = 'x' RETURN u.name $$) AS (b agtype);
  b
-----
 "a"
(1 row)

psql-11.5-5432-pgsql=#

jrgemignani avatar Jul 15 '22 19:07 jrgemignani