Skip to content

Full-path MERGE fails with a path-shape error when two input rows match #2529

Description

@YGY-001

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_case6');

SELECT *
FROM ag_catalog.cypher('age_issue_case6', $$
CREATE (:l1 {k10: '', k7: 'keep1', k9: 'r1', k8: 'k1', k0: 'v1'}),
       (:l1 {k10: '', k7: 'keep2', k9: 'r2', k8: 'k2', k0: 'v2'})
$$) AS (v agtype);

SELECT *
FROM ag_catalog.cypher('age_issue_case6', $$
UNWIND [-308062748] AS alias0
MATCH (n0:l1)
WHERE n0.k10 ENDS WITH ''
REMOVE n0.k7
WITH alias0 AS alias1, n0.k9 AS alias2, n0.k8 AS alias3,
     sin(toFloat(alias0)) AS alias4,
     log10(abs(toFloat(id(n0))) + 1) AS alias5,
     n0
WITH DISTINCT alias5 AS alias6, alias1, alias3 AS alias7,
     n0.k0 AS alias8, trim(toString(n0.k10)) AS alias9, n0
MERGE p0 = (n0) <-[r0:rt10 {id: 31, k0: 'P1Xuov6KW'}]-
           ({id: 134, k0: 'WT03gW8'})
RETURN n0, r0, alias9, alias7, alias8,
       r0.k8 AS alias10, n0.k9 AS alias11
$$) AS (n0 agtype, r0 agtype, alias9 agtype, alias7 agtype,
        alias8 agtype, alias10 agtype, alias11 agtype);

Expected

The full pattern is matched or created independently for both matching input
vertices, and two result rows are returned.

Actual

a path is of the form: [vertex, (edge, vertex)*i] where i >= 0

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