title: MySQL swap primary key values
body: <p>The accepted answer to <a href="https://stackoverflow.com/questions/2810606/sql-swap-primary-key-values">sql swap primary key values</a> fails with the error <code>Can't reopen table: 't'</code> - presumably this has something to do with opening the same table for writing twice, causing a lock.</p>
  
  <p>Is there any shortcut, or do I have to get both, set one of them to <code>NULL</code>, set the second one to the first one, then set the first one to the previously fetched value of the second?</p>