0

https://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.html#innodb-auto-increment-lock-mode-usage-implications

In the above link, there are a statement:

In all lock modes (0, 1, and 2), the behavior of the auto-increment mechanism is not defined if the value becomes larger than the maximum integer that can be stored in the specified integer type.

I cannot understand what it really means, because I am not good at English. Could somebody explain the meaning of the behavior of the auto-increment mechanism is not defined, and what will happened when next auto-increment value becomes larger than the maximum integer. please explain in the simple words.

Thank you very much.

Obsidian
  • 2,760
  • 6
  • 14
  • 24

1 Answers1

0

It is saying that if you set auto increment in some column with integer data type i.e INT - min value = -2147483648 and max value = 2147483647 with 4 bit of integer so if your auto increment value goes beyond max value then it will not work at this point.

D. Pareek
  • 559
  • 3
  • 11
  • which word can conclude it would not work at this situation; i can not really understand "the behavior of the auto-increment mechanism is not defined". – miracle00001 Oct 14 '19 at 12:54
  • what is the special result of not defined ? report a error or insert a null value? – miracle00001 Oct 14 '19 at 13:00
  • I think it will give exception as it goes beyond its max value, you can check it by setting max value (as a initial value of auto increment) and then try to insert new record. – D. Pareek Oct 14 '19 at 13:03
  • it would say Duplicate entry ..., i just cannot understand the real meaning of "the behavior of the auto-increment mechanism is not defined" in the mysql manual. what can i conclude from "the behavior of the auto-increment mechanism is not defined" ? i not good at English, so i am hard to understand this sentence – miracle00001 Oct 14 '19 at 13:29
  • It sounds another problem, please check this: https://stackoverflow.com/questions/14872215/mysql-duplicate-entry-error-for-key-with-auto-increment – D. Pareek Oct 15 '19 at 05:25
  • Also check this if value reaches its max range : https://stackoverflow.com/questions/2615417/what-happens-when-auto-increment-on-integer-column-reaches-the-max-value-in-data – D. Pareek Oct 15 '19 at 05:32