alright so what happens when your primary key hits the max value 2147483647? and how to prevent this thank you
Printable View
alright so what happens when your primary key hits the max value 2147483647? and how to prevent this thank you
Google: auto increment - What happens when auto_increment on integer column reaches the max_value in databases? - Stack Overflow :
Quote:
Jim Martin's comment from §3.6.9. "Using AUTO_INCREMENT" of the MySQL documentation:
Just in case there's any question, the AUTO_INCREMENT field /DOES NOT WRAP/. Once you hit the limit for the field size, INSERTs generate an error. (As per Jeremy Cole)A quick test with MySQL 5.1.45 results in an error of:
ERROR 1467 (HY000): Failed to read auto-increment value from storage engineYou could test for that error on insert and take appropriate action.
lol to fix it, make another table with the same things if integer's max value is exceeded
Make it a long.