Skip to content

Deleting a matched relationship and then executing full-path MERGE causes a PostgreSQL backend segmentation fault #2537

Description

@YGY-001

Docker image apache/age:release_PG18_1.7.0

Reproduction

LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case11');

SELECT *
FROM ag_catalog.cypher('age_issue_case11', $$
CREATE (a:base {id: 1})-[r1:r {k0: false}]->
       (n:base {id: 2})-[r0:s {k5: 'x'}]->(b:base {id: 3})
$$) AS (created agtype);

SELECT *
FROM ag_catalog.cypher('age_issue_case11', $$
MATCH (a:base)-[r1:r]->(n:base)-[r0:s]->(b:base)
SET r0.k5 = 'J', r1.k0 = true
WITH range(0, 0) + [0] AS keep, r1 AS old
WHERE 0 IN keep
DELETE old
CREATE (:x)
MERGE p0 = ({id: 129})-[r2:r]->(n2 {id: 130})-[:s]->(:c {id: 131})
RETURN 1
$$) AS (value agtype);

Expected

The query returns one row containing 1 and PostgreSQL remains available.

Actual

server closed the connection unexpectedly
client backend ... was terminated by signal 11: Segmentation fault

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