#13965·neo4j

List slice with end bound >= 2^31 raises 22N03 instead of clamping

Author: hkjiang26Created Sep 5, 2026Updated Sep 7, 2026
Labelsbugteam-cypherGithub Issue

Neo4j Version: neo4j:2026.07.1 (Docker)

Installation Method: Docker

API: Cypher (Bolt via cypher-shell)

Steps to reproduce

  1. On a fresh database, run:
cypher
RETURN [1,2,3,4,5][0..2147483648] AS x

Expected behavior

An out-of-range slice end should clamp to the end of the list, returning [1, 2, 3, 4, 5] — this is what FalkorDB and Memgraph return for the same query. Consistent with that, the same value used as a single index returns NULL without error (RETURN [1,2,3][4294967297]).

Actual behavior

22N03: data exception - specified numeric value out of range. Expected 'LIMIT' to be of type INTEGER NOT NULL and in the range 0 to 2147483647 but found 2147483648.

The planner converts the slice length into an int32 LIMIT, so any slice with length > 2147483647 is rejected. [0..2147483647] works, [0..2147483648] fails — the same value is handled inconsistently between indexing (NULL) and slicing (error).