Does auto increment increase at 0 if the maximum value is reached?

Does MySQL automatically reset to 0after reaching its maximum value?

In other words, if column UNSIGNED SMALLINTc AUTO_INCREMENTreaches 65535, what happens to the new INSERT?

If no values ​​are available, what happens then?

+3
source share
1 answer

The documentation is pretty clear what happens:

When the column reached the upper limit of the data type, the next attempt to generate the sequence number failed.

Read about it here .

So the answer to your question is no. It generates an error.

+4
source

All Articles