Describe the bug
List slicing may return a concrete sublist on Apache AGE when either the slice start bound or end bound is null.
For example, in the minimized repro below, [1,2,3][1..null] should evaluate to null under Cypher null-propagation semantics. Instead, AGE treats the null bound like an omitted bound and returns [2, 3].
The same issue appears symmetrically for a null start bound.
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 create_graph('expr_slice_bug');
No graph data is required beyond creating an empty graph.
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:
expr_slice_bug
- No extra extensions or special configuration were required
What is the command that caused the error?
SELECT * FROM cypher('expr_slice_bug', $$
RETURN [1, 2, 3][1..null] AS v
$$) AS (v agtype);
Returned result on AGE:
Expected behavior
The query should return:
Both Neo4j and Memgraph return null 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
The symmetric variant with a null start bound shows the same issue:
SELECT * FROM cypher('expr_slice_bug', $$
RETURN [1, 2, 3][null..2] AS v
$$) AS (v agtype);
Expected result on Neo4j and Memgraph:
Observed result on AGE:
A normal non-null slice behaves as expected on the same AGE instance:
SELECT * FROM cypher('expr_slice_bug', $$
RETURN [1, 2, 3][1..2] AS v
$$) AS (v agtype);
Observed result on AGE:
There is also an internal inconsistency when both bounds are null:
SELECT * FROM cypher('expr_slice_bug', $$
RETURN [1, 2, 3][null..null] AS v
$$) AS (v agtype);
Neo4j and Memgraph both return:
But AGE reports:
ERROR: slice start and/or end is required
So AGE appears to treat null slice bounds inconsistently:
- one
null bound is interpreted like an omitted boundary
- two
null bounds trigger an error
Neither behavior matches the null result returned by Neo4j and Memgraph.
Describe the bug
List slicing may return a concrete sublist on Apache AGE when either the slice start bound or end bound is
null.For example, in the minimized repro below,
[1,2,3][1..null]should evaluate tonullunder Cypher null-propagation semantics. Instead, AGE treats thenullbound like an omitted bound and returns[2, 3].The same issue appears symmetrically for a
nullstart bound.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?
No graph data is required beyond creating an empty graph.
What is the necessary configuration info needed?
apache/age1.7.018.1expr_slice_bugWhat is the command that caused the error?
Returned result on AGE:
Expected behavior
The query should return:
Both Neo4j and Memgraph return
nullfor the equivalent Cypher query.Environment (please complete the following information):
1.7.018.1Additional context
The symmetric variant with a
nullstart bound shows the same issue:Expected result on Neo4j and Memgraph:
Observed result on AGE:
A normal non-null slice behaves as expected on the same AGE instance:
Observed result on AGE:
There is also an internal inconsistency when both bounds are
null:Neo4j and Memgraph both return:
But AGE reports:
So AGE appears to treat
nullslice bounds inconsistently:nullbound is interpreted like an omitted boundarynullbounds trigger an errorNeither behavior matches the
nullresult returned by Neo4j and Memgraph.