Problems with auto_increment updating when (i think) it shouldn't

2009-08-07 Thread Proemial
Hey folks. I'm getting some weird behaviour out of Auto_increment. If I enter a attempt to INSERT a row into a table with a UNIQUE index, where the insert would violate uniqueness of existing data, I'm seeing the auto_increment increase even though the insert fails. The server in question is

Re: Problems with auto_increment updating when (i think) it shouldn't

2009-08-07 Thread Johnny Withers
It will also update the auto_increment column when you ROLLBACK a failed insert: mysql USE test; Database changed mysql SELECT * FROM t1\G Empty set (0.00 sec) mysql DROP TABLE t1; Query OK, 0 rows affected (0.06 sec) mysql mysql CREATE TABLE t1( - id INT UNSIGNED NOT NULL AUTO_INCREMENT,

Re: Problems with auto_increment updating when (i think) it shouldn't

2009-08-07 Thread Proemial
Hmm, that makes sense. I should have thought of that. Thanks! On Fri, Aug 7, 2009 at 12:32 PM, Johnny Withersjoh...@pixelated.net wrote: It will also update the auto_increment column when you ROLLBACK a failed insert: mysql USE test; Database changed mysql SELECT * FROM t1\G Empty set