YGY-001 opened a new issue, #2595:
URL: https://github.com/apache/age/issues/2595
## Environment
- Apache AGE `1.8.0`, PostgreSQL `18.6`
- Docker image: `apache/age:release_PG18_1.8.0`
## Reproduction
The setup contains one fixed-length path and two parallel incoming
relationships. The second `MATCH` therefore yields two rows with the same
`n1`, `n0`, and `r0` bindings.
```sql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_repro23_left');
SELECT *
FROM ag_catalog.cypher('age_repro23_left', $$
CREATE (a {id: 83})-[:rt2]->(n0:l0)
-[:rt7 {k4: true, k7: ''}]->(c:l2),
(n1:l1 {k5: false})-[:x]->(n0),
(n1)-[:y]->(n0)
$$) AS (v agtype);
SELECT ag_catalog.create_graph('age_repro23_right');
SELECT *
FROM ag_catalog.cypher('age_repro23_right', $$
CREATE (a {id: 83})-[:rt2]->(n0:l0)
-[:rt7 {k4: true, k7: ''}]->(c:l2),
(n1:l1 {k5: false})-[:x]->(n0),
(n1)-[:y]->(n0)
$$) AS (v agtype);
```
### Baseline query — `age_repro23_left`
```sql
SELECT *
FROM ag_catalog.cypher('age_repro23_left', $$
MATCH ({id: 83})-[:rt2]->(n0:l0)-[r0:rt7]->(:l2)
WHERE r0.k4 = true
WITH *
MATCH (n1:l1 {k5: false})-[]->(n0)
WHERE r0.k7 CONTAINS ''
DETACH DELETE n1, n0
RETURN {r0: r0} AS result
$$) AS (result agtype);
```
### Scope-preserving barrier query — `age_repro23_right`
```sql
SELECT *
FROM ag_catalog.cypher('age_repro23_right', $$
MATCH ({id: 83})-[:rt2]->(n0:l0)-[r0:rt7]->(:l2)
WHERE r0.k4 = true
WITH n0, r0
UNWIND [0] AS barrier0
WITH n0, r0
MATCH (n1:l1 {k5: false})-[]->(n0)
WHERE r0.k7 CONTAINS ''
WITH n0, r0, n1
UNWIND [0] AS barrier1
WITH n0, r0, n1
DETACH DELETE n1, n0
WITH {r0: r0} AS row
WITH collect(row) AS rows
UNWIND rows AS row
WITH row.r0 AS r0
RETURN {r0: r0} AS result
$$) AS (result agtype);
```
## Expected and actual
Both queries should preserve the two matched rows.
On AGE `1.8.0` / PostgreSQL `18.6`:
```text
baseline: 1 row
barrier: 2 rows
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]