Silence6666668 opened a new issue, #2382:
URL: https://github.com/apache/age/issues/2382
**Describe the bug**
Variable-length relationship patterns with a zero lower bound may fail to
produce the expected zero-hop self-binding.
In the repro below, the graph contains a single `Person` node and no
`FRIEND` relationships. Under Cypher semantics, the pattern `[:FRIEND*0..1]`
should still match with length `0`, so `f` should bind to the same node as `p`.
Instead, Apache AGE returns `f = null`, and `collect(f.name)` becomes `[]`
instead of `['Alice']`.
**How are you accessing AGE (Command line, driver, etc.)?**
- PostgreSQL `cypher(...)` wrapper through the local Python
differential-testing harness
- Reproducible directly in `psql` inside the Docker container
**What data setup do we need to do?**
```pgsql
SELECT * FROM cypher('fuzz_graph', $$
CREATE (:Person {name: 'Alice'})
$$) AS (v agtype);
```
**What is the necessary configuration info needed?**
- Plain Apache AGE Docker image was enough
- Docker image in local repro: `apache/age`
- AGE extension version: `1.7.0`
- PostgreSQL version: `18.1`
- Graph name used in repro: `fuzz_graph`
- No extra extensions or special configuration were required
**What is the command that caused the error?**
```pgsql
SELECT * FROM cypher('fuzz_graph', $$
MATCH (p:Person {name: 'Alice'})
OPTIONAL MATCH (p)-[:FRIEND*0..1]-(f:Person)
RETURN p.name AS person, f.name AS friend
$$) AS (person agtype, friend agtype);
```
Returned result on AGE:
```text
person | friend
-------+-------
Alice | null
```
**Expected behavior**
The zero-hop match should bind `f` to the same node as `p`, so the expected
result is:
```text
person | friend
-------+-------
Alice | Alice
```
Neo4j returns exactly that result for the equivalent Cypher query.
**Environment (please complete the following information):**
- Version: Apache AGE `1.7.0`
- PostgreSQL: `18.1`
- Host OS: Windows 10
- Architecture: x86_64
- Deployment: Docker
--
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]