This bug still exist in version 5.2.17.
I have the same error with MariaDB using the InnoDB engine. I also had the problem with MySQL and InnoDB.
The ID is generated using a SEQUENCE.