Is it possible that mysqli_insert_id will return an invalid identifier in high traffic applications?

In a high-traffic application, is it possible to mysqli_insert_id()return the wrong identifier or confuse the identifier between two requests INSERTthat are executed almost simultaneously?

+5
source share
4 answers

No. mysqli_insert_idreturns the largest value AUTO_INCREMENTfrom the last request of the INSERTcurrent connection. For example, it is never confused with another compound.

+8
source

No. How can I be so sure? Because it has been reported and recorded a long time ago.

+2
source

:

http://dev.mysql.com/doc/refman/5.6/en/getting-unique-id.html , :

" LAST_INSERT_ID() . . , AUTO_INCREMENT ( , NULL 0). LAST_INSERT_ID() AUTO_INCREMENT . , ".

, , , .

+1
source

Yes it is possible! If you have multiple tables to insert with the same join, and your last insert was incorrect (for example, I'm trying to insert unquoted quotes into text).

I think it returns the last successful insert identifier, which may be from another table. I just took an hour to find this. Peace

0
source

All Articles