I have percona mysql galera cluster. It inherited a MyISAM database. In order for the galera to work it had to alter to innodb. Replication is working so far so good. However I have a php application which calls for mysql_isert_id() after every insert.
In a few words : 1. A big table with many inserts flying in. 2. On every insert (in the old MyISAM db) they lock the table, do the insert query, call mysql_insert_id(), and after that unlock table.
for the replication (innodb), lock table doesn't count anymore. My question is how, can we be sure about the id that mysql_insert_id() returns when there are hundreds of ofther inserts comming in a matter of seconds?
last_insert_id() and mysql_insert_id() return the same value, but as far as I understand (last_insert) reserves ID before the actual insert(?), and mysql_insert_id do the insert and after that calls for an ID ?
I'm lost in the documentation....