Skip to content

Empty UNWIND followed by MERGE and a null-filtered WITH causes a PostgreSQL backend segmentation fault #2534

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

SELECT *
FROM ag_catalog.cypher('age_issue_case8_reduced', $$
UNWIND [] AS x
MERGE (n)
WITH x, head(range(9, 23)) AS y
WHERE y IS NULL
RETURN {x: x, y: y} AS row
$$) AS (row agtype);

Expected

The empty input produces zero rows. The query completes normally, returns
zero rows, and does not create a vertex or terminate the PostgreSQL backend.

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