mysqlinsertbigintegerindexoutofrangeexception

SQLSTATE[22003]: Numeric value out of range


I have two tables in MySQL 5.7 where:

**

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'id_guia' at row 1 (SQL: insert into r_product (id_guia, id_product, peso, created_at, updated_at) values (20220521003, 1, 100, 2022-05-21 15:27:08, 2022-05-21 15:27:08))"

**

Considering that bigint(20) can go from -9223372036854775807 to 9223372036854775807, and being unsigned can go from 0 to 18446744073709551615, thus an eleven character's integer like 20220521001 should fit in there without any problem, then what am I doing wrong?


Solution

  • Seems somehow that I've overflown the capabilities of Mysql 5.7. The solution for this problem was to abandon MySQL 5.7 and migrating to a MySQL 8 DBMS where my code worked perfectly as it should.