title: MySql - Is tables name swap is an atomic operation
body: <p>I have a table, let's call it <code>myTbl</code>.
  I also have two tables - <code>Monitor</code> and <code>Monitor_bkp</code>.
  now i built a Trigger to create a new row in Monitor whenever the is an update in <code>myTbl</code>:</p>
  
  <pre><code>CREATE TRIGGER mon_task_after_update_task 
  AFTER UPDATE ON myTbl
  FOR EACH ROW INSERT INTO Monitor VALUES(new.id, SYSDATE())
      ON DUPLICATE KEY UPDATE last_modified=SYSDATE();
  </code></pre>
  
  <p>all works good, and i have a lot of updates to <code>myTbl</code> at all time.
  now my question is if i'll swap the names of <code>Monitor</code> and <code>Monitor_bkp</code>, using</p>
  
  <pre><code>RENAME TABLE foo TO foo_old, foo_new To foo;
  </code></pre>
  
  <p>Is there a possibility the trigger will fire while the swap is going and if so will it fail?</p>