Hello all ! )
I would like to know if IDs generated by an AUTO INCREMENT column, when doing a single multi-row insert, are always in order.
From MySQL documentation :
10.10.3. Information Functions
Sweet ! But...
Multi-row INSERTs
Any idea ?
I would like to know if IDs generated by an AUTO INCREMENT column, when doing a single multi-row insert, are always in order.
From MySQL documentation :
10.10.3. Information Functions
| Quote: |
If you insert multiple rows using a single INSERT statement, LAST_INSERT_ID() returns the value generated for the first inserted row only. The reason for this is to make it possible to reproduce easily the same INSERT statement against some other server. |
Sweet ! But...
Multi-row INSERTs
| Quote: |
Anyway, my question is this. If I do a single-statement multi-line insert, are the auto-increment IDs of the rows inserted guaranteed to be sequential? Bear in mind also that I'm using InnoDB tables here. |
| Quote: |
I'm surprised that nobody knows the answer on that for sure... |
Any idea ?
Comment