I have the following setup:
A query like:
"INSERT INTO table (c1, c2,...) values (v01, v02,...), (v11, v12,...)..."
The table has a primary key with auto increment. I need to know what are the indexes for each row inserted.
One way to do this would be to take the last rows index and inserted indexes are from lastRowIndex - nrRows to lastRowIndex.
My problem/uncertainty is: If another insert is run in parallel with this one that inserts rows in the same table (another user calls the same function for example), is there any chance (no matter how small) to insert a row between those generated by the query stated before? Again... is very important (the reason is clear... it kills the ids structure) that that won't happen so I need to be sure.
Or any chance for the ids not to be consecutive for no matter what reason.