MySQL ERROR 1690 (22003): BIGINT UNSIGNED value is out of range
Arithmetic on UNSIGNED columns produced a negative result.
Seen on:
MySQL
Meaning
UNSIGNED - UNSIGNED is unsigned in MySQL, so 3 - 5 overflows. Stock or balance calculations hit this.
Common causes
- Subtracting unsigned columns
- Decrementing below zero
⚡ Quick fix
- CAST to SIGNED before subtracting
- Use NO_UNSIGNED_SUBTRACTION sql_mode
- Guard against going below zero
Detailed fix by platform
MySQL
SELECT CAST(stock AS SIGNED) - CAST(reserved AS SIGNED) AS available FROM products;
How to diagnose
- Expression — Which subtraction?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026