Suppose a huge database. For example I have more than 4294967295(for mysql INT) users. In any column which type is int and auto_increment, what happens if that column reach the max value?
Overflow in int As int data type is 32 bit in Java, any value that surpasses 32 bits gets rolled over. In numerical terms, it means that after incrementing 1 on Integer. MAX_VALUE (2147483647), the returned value will be -2147483648. In fact you don't need to remember these values and the constants Integer.
The range of an int data type is -2,147,483,648 to 2,147,483,647.
In MySQL integer int(11) has size is 4 bytes which equals 32 bit. Signed value is : - 2^(32-1) to 0 to 2^(32-1)-1 = -2147483648 to 0 to 2147483647. Unsigned values is : 0 to 2^32-1 = 0 to 4294967295.
The int will overflow and you will not be able to insert more records to that table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With