replace, insert into ... on duplicate key 这类语句都会删行
xiaoxinshiwo
2018-10-16 17:41:25 +08:00
看了下 mysql 官方文档,还挺复杂 The exception is for “ mixed-mode inserts ”, where the user provides explicit values for an AUTO_INCREMENT column for some, but not all, rows in a multiple-row “ simple insert ”. For such inserts, InnoDB allocates more auto-increment values than the number of rows to be inserted. However, all values automatically assigned are consecutively generated (and thus higher than) the auto-increment value generated by the most recently executed previous statement. “ Excess ” numbers are lost. 参考: https://dev.mysql.com/doc/refman/5.5/en/innodb-auto-increment-handling.html