AQL unary plus/minus on bind parameters silently return incorrect values
Author: the-ShallowCreated Jul 11, 2026Updated Jul 20, 2026
Description
Applying unary + or - directly to a numeric bind parameter can produce 0 instead of the mathematically correct value. Equivalent expressions using binary subtraction, a LET variable, or NOOPT() produce the correct value.
This is silent result corruption: the query succeeds without a warning but returns incorrect data.
Environment
- ArangoDB: 3.12.9-4
- Deployment: official Docker image, single server
- OS hosting Docker: Windows / Docker Desktop / WSL2
- API: HTTP cursor API
Steps to reproduce
Run:
RETURN {
directPlus: +@x,
directMinus: -@x,
doubleMinus: -(-@x),
viaSubtraction: 0 - @x,
absDirectMinus: ABS(-@x),
absSubtraction: ABS(0 - @x),
nooptMinus: -NOOPT(@x)
}Bind variables:
{"x": 1}Expected result
{
"directPlus": 1,
"directMinus": -1,
"doubleMinus": 1,
"viaSubtraction": -1,
"absDirectMinus": 1,
"absSubtraction": 1,
"nooptMinus": -1
}Actual result
Direct unary expressions evaluate to zero, while subtraction and NOOPT() forms evaluate correctly. The exact response can be generated with the attached PowerShell reproducer.
Additional evidence
These equivalent forms work:
LET y = @x RETURN -y
RETURN 0 - @x
RETURN -NOOPT(@x)
RETURN -1The issue reproduces through the raw REST API, so it is independent of Python, Hypothesis, pytest, and client-driver serialization.
Source: arangodb/arangodb