1341
MySQLwarningdatahigh confidence
Truncated incorrect value
Production Risk
High — data integrity risk if strict mode is off.
What this means
A value was truncated or coerced because it did not fit the target type. In strict mode this becomes an error.
Why it happens
- 1Inserting a string into a numeric column
- 2Date/time value outside the valid range
- 3Numeric overflow in a DECIMAL column
How to reproduce
trigger — this will error
trigger — this will error
INSERT INTO t (num_col) VALUES ('abc');expected output
Warning 1292: Truncated incorrect DOUBLE value: 'abc'
Fix 1
Validate data types before insert
Why this works
Ensure application sends correctly typed values.
Fix 2
Cast explicitly
Cast explicitly
INSERT INTO t (num_col) VALUES (CAST('123' AS DECIMAL(10,2)));Why this works
Explicit CAST makes the conversion intent clear.
What not to do
✕
Version notes
Sources
Official documentation ↗
MySQL 8.0 — 1292/1341 ER_TRUNCATED_WRONG_VALUE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev