#22907·arangodb

AQL unary plus/minus on bind parameters silently return incorrect values

Author: the-ShallowCreated Jul 11, 2026Updated Jul 20, 2026

repro_1_unary_bind_results.py

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:

aql
RETURN {
  directPlus: +@x,
  directMinus: -@x,
  doubleMinus: -(-@x),
  viaSubtraction: 0 - @x,
  absDirectMinus: ABS(-@x),
  absSubtraction: ABS(0 - @x),
  nooptMinus: -NOOPT(@x)
}

Bind variables:

json
{"x": 1}

Expected result

json
{
  "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:

aql
LET y = @x RETURN -y
RETURN 0 - @x
RETURN -NOOPT(@x)
RETURN -1

The issue reproduces through the raw REST API, so it is independent of Python, Hypothesis, pytest, and client-driver serialization.