Re: About AUTO-INC In different mode (1,2 or 3)
Posted by:
five small
Date: April 22, 2021 07:30AM
In MySQL offical:
mysql> CREATE TABLE t1 (
-> c1 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> c2 CHAR(1)
-> ) ENGINE = INNODB;
And that the most recent automatically generated sequence number is 100.
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 |
+-----+------+
The values of x and y are unique and larger than any previously generated rows. However, the specific values of x and y depend on the number of auto-increment values generated by concurrently executing statements.
-------------------------------------------------------------------------------
This y=x+1, right?
Subject
Views
Written By
Posted
838
April 21, 2021 05:38AM
345
April 21, 2021 10:13AM
349
April 21, 2021 11:50PM
315
April 22, 2021 12:13AM
347
April 22, 2021 02:31AM
Re: About AUTO-INC In different mode (1,2 or 3)
299
April 22, 2021 07:30AM
355
April 22, 2021 09:56AM
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.