AUTO_INCREMENT With InnoDBAUTO_INCREMENT column is specified for an InnoDB table, the table handle in the InnoDB data dictionary contains a special counter called the auto-increment counter.
InnoDB uses the in-memory auto-increment counter as long as the server runs.
InnoDB reinitializes the counter for each table for the first INSERT to the table.
AUTO_INCREMENT column, InnoDB increments the counter by one and assigns the new value to the column.
NULL or 0 for the AUTO_INCREMENT column in an INSERT, InnoDB treats the row as if the value had not been specified and generates a new value for it.
AUTO_INCREMENT column if transactions that have generated numbers using the counter are rolled back.
How does InnoDB handle FOREIGN_KEY constraints?
© 2007 John Michael Pierobon