How to solve mysql error Out of range value for column 'xxx' at row 1?

This error, literally, means that the value we want to put exceeds the length, so this error is reported. I encountered this error several times and encountered it online. At the beginning, I was always puzzled, because I haven't checked it to be longer than the length I set. Here, I default that the length must be too large. In fact, it may be too small. For example, I have encountered these times. It is because the database is set to bigint, but the actual business is in circulation, which causes the value assigned to become a negative number, that is, a negative number is assigned to a field of type bigint, so this error is reported.

planDetail.setDoingQuantity(planDetail.getDoingQuantity() - detail.getQuantity());
Published 64 original articles · won praise 0 · Views 2507

Guess you like

Origin blog.csdn.net/weixin_44853669/article/details/105354146