Describe the bug
List-comprehension projection over a null element may produce a nested list instead of null.
In the repro below, Apache AGE evaluates:
as:
Instead of:
This also affects mixed lists such as [1, null, 2], where the null element becomes [null, 1] instead of staying null.
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?
No graph data is required beyond creating an empty graph:
SELECT create_graph('fuzz_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:
fuzz_graph
- No extra extensions or special configuration were required
What is the command that caused the error?
SELECT * FROM cypher('fuzz_graph', $$
RETURN [x IN [null] | x + 1] AS v
$$) AS (v agtype);
Returned result on AGE:
Expected behavior
The null element should stay null under the arithmetic projection, so the expected result is:
Neo4j returns [null], and Memgraph also returns [null].
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 same issue appears in a mixed list:
SELECT * FROM cypher('fuzz_graph', $$
RETURN [x IN [1,null,2] | x + 1] AS v
$$) AS (v agtype);
Apache AGE returns:
Expected result:
Neo4j and Memgraph both return [2, null, 3].
Two nearby control cases behave correctly on the same AGE instance:
- The same list comprehension without arithmetic projection:
SELECT * FROM cypher('fuzz_graph', $$
RETURN [x IN [1,null,2] | x] AS v
$$) AS (v agtype);
Observed result:
- The arithmetic projection on a list without null elements:
SELECT * FROM cypher('fuzz_graph', $$
RETURN [x IN [1,2] | x + 1] AS v
$$) AS (v agtype);
Observed result:
So the issue appears specifically when the list-comprehension projection expression operates on a null element.
Describe the bug
List-comprehension projection over a
nullelement may produce a nested list instead ofnull.In the repro below, Apache AGE evaluates:
as:
Instead of:
This also affects mixed lists such as
[1, null, 2], where the null element becomes[null, 1]instead of stayingnull.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.1fuzz_graphWhat is the command that caused the error?
Returned result on AGE:
Expected behavior
The null element should stay null under the arithmetic projection, so the expected result is:
Neo4j returns
[null], and Memgraph also returns[null].Environment (please complete the following information):
1.7.018.1Additional context
The same issue appears in a mixed list:
Apache AGE returns:
Expected result:
Neo4j and Memgraph both return
[2, null, 3].Two nearby control cases behave correctly on the same AGE instance:
Observed result:
Observed result:
So the issue appears specifically when the list-comprehension projection expression operates on a
nullelement.