I assume that you are using PHP from the comments on this. (not currently listed as "php"). I'll just add 2 cents here
I am trying to use LAST_INSERT_ID in an auto-add index that passed the signed value of int 2147483647. This column is an unsigned int. However, LAST_INSERT_ID () returns an invalid negative value. Exploring this, I found a couple of comments indicating that this is the nature of this function. But I can not find it officially documented. There are several bug reports that have been open for several years.
Function
mySQL LAST_INSERT_ID will return the identifier from the last INSERT in the AUTO_INCREMENT column (in the current connection), so if your column is INTEGER UNSIGNED , as you said, it can return values greater than 2147483647. This is the correct behavior.
So, I need to know if this is actually a known bug and / or if I can do something about it. Do I need to upgrade mySQL to a newer version?
The mySQL data type has little to do with the view you chose to use in PHP, so the problem is not on the mySQL server. If your PHP installation cannot handle numbers so BIG, then you can treat it like a string (Shadow Radiance said).
source share