Comments - AUTO_INCREMENT FAQ

3 years, 4 months ago Emmanuel KARTMANN

Hello, Regarding section "Does the auto_increment field have to be primary key?" I would strongly advise to say YES (or for MyISAM the auto_increment key must BE PART OF the primary key).

I had a very hard time with a MyISAM table with an auto_increment field that was declared as a simple KEY : the replication kept on failing with errors message like "Ca'nt find record in mytable":

Slave SQL: Could not execute Update_rows_v1 event on table mydb.mytable ; Can't find record in 'mytable', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin...., end_log_pos ..., Gtid 0-1-..., Internal MariaDB error code: 1032

We altered the MyISAM table to set the auto_increment field as the primary key and the replication worked fine afterwards...

Regards,

E.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.