Search Results
https://dev.mysql.com/doc/refman/8.4/en/innodb-auto-increment-handling.html
InnoDB provides a configurable locking mechanism that can significantly improve scalability and performance of SQL statements that add rows to tables with AUTO_INCREMENT columns. To use the AUTO_INCREMENT mechanism with an InnoDB table, an ...The ...
https://dev.mysql.com/doc/refman/8.4/en/example-auto-increment.html
For example: INSERT INTO animals (id,name) VALUES(NULL,'squirrel'); When you insert any other value into an AUTO_INCREMENT column, the column is set to that value and the sequence is reset so that the next automatically generated value follows ...
https://dev.mysql.com/doc/refman/8.4/en/replication-features-auto-increment.html
Statement-based replication of AUTO_INCREMENT, LAST_INSERT_ID(), and TIMESTAMP values is carried out subject to the following exceptions: A statement invoking a trigger or function that causes an update to an AUTO_INCREMENT column is not replicated ...This occurs because the order in which the rows are numbered depends on the specific storage engine used for the table and the order in which the rows were ...
https://dev.mysql.com/doc/connectors/en/connector-j-usagenotes-last-insert-id.html
getGeneratedKeys() is the preferred method to use if you need to retrieve AUTO_INCREMENT keys and through JDBC; this is illustrated in the first example below. The final example shows how updatable result sets can retrieve the AUTO_INCREMENT value ...The second example shows how you can retrieve the same value using a standard SELECT LAST_INSERT_ID() ...
https://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-last-insert-id.html
getGeneratedKeys() is the preferred method to use if you need to retrieve AUTO_INCREMENT keys and through JDBC; this is illustrated in the first example below. The final example shows how updatable result sets can retrieve the AUTO_INCREMENT value ...The second example shows how you can retrieve the same value using a standard SELECT LAST_INSERT_ID() ...
https://dev.mysql.com/doc/internals/en/logging-updates-auto-incement-columns.html
Status of this subsection: not started 2009-10-21 ...
https://dev.mysql.com/doc/refman/8.4/en/create-table.html
When you insert a value of NULL (recommended) or 0 into an indexed AUTO_INCREMENT column, the column is set to the next sequence value. To retrieve an AUTO_INCREMENT value after inserting a row, use the LAST_INSERT_ID() SQL function or the ...| ...
https://dev.mysql.com/doc/refman/8.4/en/information-functions.html
LAST_INSERT_ID(), LAST_INSERT_ID(expr) With no argument, LAST_INSERT_ID() returns a BIGINT UNSIGNED (64-bit) value representing the first automatically generated value successfully inserted for an AUTO_INCREMENT column as a result of the most ...It ...
https://dev.mysql.com/doc/refman/8.4/en/alter-table-examples.html
For MyISAM tables, you can set the first sequence number by executing SET INSERT_ID=value before ALTER TABLE or by using the AUTO_INCREMENT=value table option. With MyISAM tables, if you do not change the AUTO_INCREMENT column, the sequence number ...For NDB tables, it is also possible to change the storage type used for a table or ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-insert-id.html
uint64_t mysql_insert_id(MYSQL *mysql) Description Returns the value generated for an AUTO_INCREMENT column by the previous INSERT or UPDATE statement. Use this function after you have performed an INSERT statement into a table that contains an ...