Describe the bug
When a query has multiple input rows, creating a node into a variable and then immediately creating a relationship to that variable may fail with:
vertex assigned to variable new was deleted
In the repro below, the query should create one new Person node per matched a row, connect a to that new node, and then return the matched names.
Instead, Apache AGE errors out during execution.
How are you accessing AGE (Command line, driver, etc.)?
- PostgreSQL
cypher(...) wrapper through the local Python differential-testing harness
- Reproducible directly in
psql inside the Docker container
What data setup do we need to do?
SELECT * FROM cypher('fuzz_graph', $$
CREATE (:Person {name:'Alice'}),
(:Person {name:'Bob'})
$$) AS (v agtype);
What is the necessary configuration info needed?
- Plain Apache AGE Docker image was enough
- Docker image in local repro:
apache/age
- AGE extension version:
1.7.0
- PostgreSQL version:
18.1
- Graph name used in repro:
fuzz_graph
- No extra extensions or special configuration were required
What is the command that caused the error?
SELECT * FROM cypher('fuzz_graph', $$
MATCH (a:Person)
CREATE (new:Person {name:'Zoe'})
CREATE (a)-[:FRIEND]->(new)
RETURN a.name AS a_name
$$) AS (a_name agtype);
Returned result on AGE:
ERROR: vertex assigned to variable new was deleted
Expected behavior
The query should succeed and return the two matched rows:
Neo4j returns exactly those two rows for the equivalent Cypher query.
Environment (please complete the following information):
- Version: Apache AGE
1.7.0
- PostgreSQL:
18.1
- Host OS: Windows
- Architecture: x86_64
- Deployment: Docker
Additional context
Two nearby control cases behave correctly on the same AGE instance:
- The same pattern works when restricted to a single input row:
SELECT * FROM cypher('fuzz_graph', $$
MATCH (a:Person)
WITH a LIMIT 1
CREATE (new:Person {name:'Nia'})
CREATE (a)-[:FRIEND]->(new)
RETURN a.name AS a_name
$$) AS (a_name agtype);
Observed result:
- The multi-row query also works if the target node is created anonymously instead of being bound to a variable:
SELECT * FROM cypher('fuzz_graph', $$
MATCH (a:Person)
CREATE (a)-[:FRIEND]->(:Person {name:'Mia'})
RETURN a.name AS a_name
$$) AS (a_name agtype);
Observed result:
- Creating the node into
new without immediately using it in the relationship also works:
SELECT * FROM cypher('fuzz_graph', $$
MATCH (a:Person {name:'Alice'})
CREATE (new:Person {name:'Eve'})
RETURN a.name AS a_name, new.name AS new_name
$$) AS (a_name agtype, new_name agtype);
Observed result:
So the failure appears to be specifically tied to multi-row execution of:
CREATE a new node bound to a variable
- immediately
CREATE a relationship to that bound node
Describe the bug
When a query has multiple input rows, creating a node into a variable and then immediately creating a relationship to that variable may fail with:
In the repro below, the query should create one new
Personnode per matchedarow, connectato that new node, and then return the matched names.Instead, Apache AGE errors out during execution.
How are you accessing AGE (Command line, driver, etc.)?
cypher(...)wrapper through the local Python differential-testing harnesspsqlinside the Docker containerWhat data setup do we need to do?
What is the necessary configuration info needed?
apache/age1.7.018.1fuzz_graphWhat is the command that caused the error?
Returned result on AGE:
Expected behavior
The query should succeed and return the two matched rows:
Neo4j returns exactly those two rows for the equivalent Cypher query.
Environment (please complete the following information):
1.7.018.1Additional context
Two nearby control cases behave correctly on the same AGE instance:
Observed result:
Observed result:
newwithout immediately using it in the relationship also works:Observed result:
So the failure appears to be specifically tied to multi-row execution of:
CREATEa new node bound to a variableCREATEa relationship to that bound node