Skip to content

Variable-length path with RETURN * fails with a row/column definition error #2540

Description

@YGY-001

Environment

Docker image: apache/age:release_PG18_1.8.0

Reproduction

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].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions