apache / apache/age

Full-path `MERGE` followed by a `WITH` constant `STARTS WITH` predicate causes a PostgreSQL backend segmentation fault

Open
#2,536 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Docker image `apache/age:release_PG18_1.7.0

**Reproduction**

```sql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case10');

SELECT *
FROM ag_catalog.cypher('age_issue_case10', $$
MERGE p = (:a)-[:r]->(n)
WITH 1 AS y
WHERE ('a' STARTS WITH 'a')
RETURN y
$$) AS (y agtype);
```

**Expected**

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

**Actual**

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

Contributor guide

Open the contributing guide

Research direction

Reproduce the SQL through ag_catalog.cypher using the apache/age:release_PG18_1.7.0 Docker image, then trace handling of the MERGE/WITH/STARTS WITH combination in the C/PostgreSQL extension. Done means the query returns one row containing 1, PostgreSQL remains available, and regression coverage verifies that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, docker, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.