title: MySQL and Autoincrement Consistency
body: <p>I would like to grab the auto increment id of a table right after an insert.  The LAST_INSERT_ID() should work, but is it 100% full proof?  Meaning if two statements are executed at the same time in a Stored Procedure, will it use the last ID within that context, or from the other connection that was made?  </p>
  
  <pre><code>INSERT INTO foo (auto,text)
      VALUES(NULL,'text');         # generate ID by inserting NULL
  INSERT INTO foo2 (id,text)
      VALUES(LAST_INSERT_ID(),'text');  # use ID in second table
  </code></pre>