This topic describes errors related to data truncation and the troubleshooting procedure.
Error: ERROR 1265 (01000): Data truncated for column '%.*s' at row %ld
Error code
Error code in OceanBase Database: 4249
MySQL error code: 1265
Example
When you insert data into the ty table, this error is returned.
obclient> INSERT INTO ty VALUE('1970-01-01');
ERROR 1265 (01000): Data truncated for argument
Troubleshooting procedure
View the schema of the
tytable.obclient> DESC ty; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | c1 | year(4) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ 1 row in setInsert a valid value based on the field type.
obclient> INSERT INTO ty VALUE('1970'); Query OK, 1 row affectedView the inserted data.
obclient> SELECT * FROM ty; +------+ | c1 | +------+ | 1970 | +------+ 1 row in set