Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql auto increment error
    text
    copied!<p>I have a simple</p> <pre><code>INSERT INTO t1 (fields...) (SELECT fields... FROM t2); </code></pre> <p>it inserts around 8.000 rows and the auto increment value of the table is set to ~16.000, but it's not exactly 2x as much. I don't include the auto incremented id in the query, and the tables are truncated. Can it be a bug? I have version 5.5.24. Why is that, and how can I avoid this?</p> <pre><code>CREATE TABLE `order` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `` int(4) NOT NULL COMMENT '', `` int(6) NOT NULL COMMENT '', `` varchar(255) NOT NULL COMMENT '', `` varchar(255) NOT NULL COMMENT '', `` bigint(10) unsigned NOT NULL COMMENT '', `` int(5) unsigned NOT NULL COMMENT '', `` int(5) unsigned NOT NULL COMMENT '', `` int(8) unsigned NOT NULL COMMENT '', `` varchar(255) DEFAULT NULL COMMENT '', `` int(3) DEFAULT NULL COMMENT '', `` int(3) DEFAULT NULL COMMENT '', `` date NOT NULL COMMENT '', `` date DEFAULT NULL, `` date DEFAULT NULL COMMENT '', `` int(5) DEFAULT NULL COMMENT '', `` varchar(2) DEFAULT NULL COMMENT '', `` int(5) DEFAULT NULL COMMENT '', `` varchar(255) DEFAULT NULL, `` varchar(255) DEFAULT NULL, `` char(1) DEFAULT NULL, `` datetime DEFAULT NULL, `` int(10) unsigned DEFAULT NULL, `` datetime DEFAULT NULL, `` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `` (``), KEY `` (``), KEY `` (``), CONSTRAINT `` FOREIGN KEY (``) REFERENCES `users` (`id`), CONSTRAINT `` FOREIGN KEY (``) REFERENCES `users` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8440 DEFAULT CHARSET=utf8 </code></pre> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload