Variable-length path with `RETURN *` fails with a row/column definition error
- Dominant language
- C
- Stars
- 4.8k
- Forks
- 523
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
### Environment
Docker image: `apache/age:release_PG18_1.8.0`
### Reproduction
```sql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case14');
SELECT *
FROM ag_catalog.cypher('age_issue_case14', $$
CREATE (a:Start {id: 1})-[:R]->(b:End {id: 2})
RETURN b
$$) AS (b agtype);
```
```
SELECT *
FROM ag_catalog.cypher('age_issue_case14', $$
MATCH p = ()-[*1]->(n:End {id: 2})
RETURN *
$$) AS (p agtype, n agtype);
```
### Expected behavior
The query should return the matched path and node, equivalent to:
```
SELECT *
FROM ag_catalog.cypher('age_issue_case14', $$
MATCH p = ()-[*1]->(n:End {id: 2})
RETURN p, n
$$) AS (p agtype, n agtype);
```
### Actual behavior
ERROR: return row and column definition list do not match
The explicit projection RETURN p, n succeeds on the same graph, while RETURN * fails. The issue also reproduces with [*1..2].
Contributor guide
Research direction
Start by running the two ag_catalog.cypher reproductions in the issue against apache/age:release_PG18_1.8.0, comparing RETURN * with RETURN p, n and the [*1..2] case. Trace the cypher entry point and row/column definition handling for variable-length paths. Done means RETURN * returns the path and node without a row and column definition mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100