Repository navigation
Description
ArcadeDB version
Observed on Docker images:
arcadedata/arcadedb:26.3.2arcadedata/arcadedb:26.4.1-SNAPSHOTarcadedata/arcadedb:26.4.2
Environment
- Host OS: Windows 10
- Architecture: x86_64
- Deployment: Docker
- ArcadeDB endpoint: HTTP
/api/v1/command/arcade - Request mode matches ArcadeDB Studio:
language: opencypherserializer: studio
- Differential comparison target: Neo4j Docker
neo4j:latest
Describe the bug
When a variable becomes null through OPTIONAL MATCH and is then carried through WITH, a later MATCH on that same variable may incorrectly keep the row alive on ArcadeDB.
In Cypher semantics, if c is already bound to null, then:
MATCH (c:City {population: 8000000})should not rebind c or preserve the row. Neo4j returns no rows.
ArcadeDB keeps the row and still returns c = null.
To Reproduce
Setup:
CREATE (:Person {name:'Alice', city:'New York'}),
(:City {name:'New York', population:8000000});Query:
MATCH (p:Person {city:'New York'})
OPTIONAL MATCH (p)-[:LIVES_IN]->(c:City)
WITH p, c
MATCH (c:City {population:8000000})
RETURN p.name AS p, c.name AS c;Expected behavior
The OPTIONAL MATCH finds no LIVES_IN relationship, so c is null.
The later MATCH on c should therefore eliminate the row.
Observed Neo4j result:
0 rows
Actual behavior
ArcadeDB returns:
Alice, null
So the row survives even though the carried variable c is still null.
Control cases
The OPTIONAL MATCH by itself behaves normally:
MATCH (p:Person {city:'New York'})
OPTIONAL MATCH (p)-[:LIVES_IN]->(c:City)
WITH p, c
RETURN p.name AS p, c.name AS c;Observed result on both Neo4j and ArcadeDB:
Alice, null
The incorrect survival still happens if the optional relationship variable is carried too:
MATCH (p:Person {city:'New York'})
OPTIONAL MATCH (p)-[r:LIVES_IN]->(c:City)
WITH p, c, r
MATCH (c:City {population:8000000})
RETURN p.name AS p, c.name AS c;Neo4j returns no rows.
ArcadeDB still returns:
Alice, null
Even adding a no-op style write on the unmatched relationship alias does not change the behavior:
MATCH (p:Person {city:'New York'})
OPTIONAL MATCH (p)-[r:LIVES_IN]->(c:City)
SET r.duration = 5
WITH p, c, r
MATCH (c:City {population:8000000})
RETURN p.name AS p, c.name AS c;Neo4j returns no rows.
ArcadeDB still returns:
Alice, null
This suggests the issue is specifically that a later MATCH does not correctly eliminate rows when the referenced carried variable is already null.
Activity
fix: cypher -> Same-statement write-then-read visibility
lvca commentedon May 6, 2026
Fixed
fix: cypher -> Same-statement write-then-read visibility
fix: cypher -> Same-statement write-then-read visibility
chore(deps): bump com.google.api.grpc:proto-google-common-protos from…
fix: cypher -> Same-statement write-then-read visibility