title: INSERT INTO ... ON DUPLICATE UPDATE all values
body: <p>Can I <strong>safely</strong> update <strong>all</strong> values like this:</p>
  
  <pre><code>INSERT INTO tbl_name SET `a`=:a, `b`=:b, ... `z`=:z
  ON DUPLICATE KEY UPDATE
  `a`=VALUES(`a`), `b`=VALUES(`b`), ... `z`=VALUES(`z`);
  </code></pre>
  
  <p>I have tried it, and it works. But it's tested only on one innodb table.</p>
  
  <p>I have found these related questions <a href="https://stackoverflow.com/questions/11254674/mysql-on-duplicate-key-update-all-values">1</a>, <a href="https://stackoverflow.com/questions/9537710/is-there-a-way-to-use-on-duplicate-key-to-update-all-that-i-wanted-to-insert">2</a>, <a href="https://stackoverflow.com/questions/294661/what-is-the-best-way-to-insert-into-and-update-a-single-row-table-in-mysql">3</a> but there's no mention that updating ALL columns (unique and/or pk) is 100% safe. </p>
  
  <p>It doesn't create any error on updating PK with same value.<br>
  It doesn't create any error on updating Unique col with same value.  </p>
  
  <p><em>So, is it 100% safe to use? If not, what are corner cases, when it breaks?</em></p>
  
  <p>--------- <strong>edit</strong> -------------<br>
  added ... up to z col  </p>