MySQL Forums
Forum List  »  Newbie

About innodb-auto-increment-handling
Posted by: five small
Date: April 28, 2022 10:28PM

Recently I learned AUTO-INC Locks, I see this DOCUMENTATION(https://dev.mysql.com/doc/refman/8.0/en/innodb-auto-increment-handling.html)
consider the following “mixed-mode insert” statement:(innodb_autoinc_lock_mode = 2)

mysql> INSERT INTO t1 (c1,c2) VALUES (1,'a'), (NULL,'b'), (5,'c'), (NULL,'d');

With innodb_autoinc_lock_mode set to 2 (“interleaved”), the four new rows are:

mysql> SELECT c1, c2 FROM t1 ORDER BY c2;
+-----+------+
| c1 | c2 |
+-----+------+
| 1 | a |
| x | b |
| 5 | c |
| y | d |
+-----+------+

In my opinion,there are only two cases :

y = 6
or
y = x+1

Am I right? Thank you.

Looking forward to your reply~

Options: ReplyQuote


Subject
Written By
Posted
About innodb-auto-increment-handling
April 28, 2022 10:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.