title: Initiate truncate, then write
body: <p>If I initiate a <code>TRUNCATE</code> on a table, what happens to <code>INSERT</code>s executed against that table? Are they queued until the <code>TRUNCATE</code> completes, or are they simply discarded? I know this condition is quite rare but it's possible.</p>
  
  <p>I'm using PDO transactions with MySQL, however I have to <code>TRUNCATE</code> the table after the transaction. I don't want to use <code>DELETE</code> from within the transaction as it's slower than <code>TRUNCATE</code>. This is for a stats logger on a website, so concurrent requests to the same table are easily possible.</p>
  
  <p>The queries executed are (from the query log):</p>
  
  <pre><code>SHOW PROCESSLIST
  SELECT COUNT(*) AS Counter FROM stats_current
  START TRANSACTION
  LOCK TABLES stats_current WRITE, stats WRITE
  UNLOCK TABLES
  LOCK TABLES stats_customer_current WRITE, stats_customer WRITE
  UNLOCK TABLES
  LOCK TABLES stats_update_queue WRITE, stats_customer_current WRITE, stats_customer WRITE
  UNLOCK TABLES
  TRUNCATE stats_update_queue
  commit
  </code></pre>