apache / apache/age

Multi-row CREATE followed by startNode/endNode reports a nonexistent graphid

Open
#2,552 0 comments 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


### Environment

- Apache AGE 1.8.0
- PostgreSQL 18.6
- Docker image: apache/age:release_PG18_1.8.0

### Reproduction

Execute the following Cypher through the standard AGE
`ag_catalog.cypher('graph_name', $$...$$)` interface:

```cypher
UNWIND [1, 2] AS x
CREATE (a)-[r:R]->(b)
WITH startNode(r) AS s
RETURN s
```
### Expected
The query returns two start vertices.
### Actual
```text
ERROR: graphid 281474976710659 does not exist
```
The graphid is generated internally and is not present in the Cypher input.
### Controls
The one-row form succeeds:
```cypher
UNWIND [1] AS x
CREATE (a)-[r:R]->(b)
WITH startNode(r) AS s
RETURN s
```
Directly returning the created entities for two rows also succeeds:
```cypher
UNWIND [1, 2] AS x
CREATE (a)-[r:R]->(b)
RETURN a, b, r
```

Contributor guide

Open the contributing guide

Research direction

Start by running the two-row reproduction through ag_catalog.cypher, then compare it with the one-row and direct-entity-return controls. Trace the handling of created relationships passed to startNode(r); done means the two-row query returns both start vertices without a nonexistent graphid error while the controls continue to succeed.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.