title: How to swap table names in cast that both tables already created?
body: <p>Let's suppose that we have two tables <code>new</code> and <code>current</code> (both are innodb).
  We should atomically truncate <code>current</code> table contents and fill with new content from <code>new</code> table. </p>
  
  <p>Possible ways:</p>
  
  <ul>
  <li>swap table names <code>RENAME TABLE</code>, but it can't help because both tables are already created</li>
  <li>start transaction; truncate <code>current</code> table; insert into <code>current</code> select from <code>new</code>; commit transaction - it is ok, but is it possible to make all this actions in transcational way?</li>
  <li>create on fly third table and use it like a bridge</li>
  </ul>
  
  <p>What is the best practice?</p>
  
  <p>UPD: I suppose this will work perfectly: <code>RENAME TABLE current TO xxx, new TO current; xxx TO new</code></p>