title: MySQL: Updating entry WITHOUT updating timestamp WHEN using update ... join
body: <p>I have a table like</p>
  
  <pre><code>create table test (
      id int,
      a int,
      mtime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  );
  </code></pre>
  
  <p>Under normal circumstances, I need mtime auto update when I modify the record. But sometimes I need keep mtime unchanged. </p>
  
  <p>Here is a <a href="https://stackoverflow.com/questions/2844863/mysql-updating-entry-without-updating-timestamp">related question</a>. From that, I get what I need is this statement:</p>
  
  <pre><code>update table test set a = 3, mtime = mtime;
  </code></pre>
  
  <p>It works almost perfectly, except <strong>ONE CASE</strong> : <strong>update ... join ...</strong>. For example,</p>
  
  <pre><code>UPDATE test
  JOIN
      (select test.id from test
      JOIN middle on middle.test_id = test.id
      JOIN test_2 on middle.test_2_id = test_2.id
      WHERE test_2.id = 3) tmp
  ON test.id = tmp.id
  SET test.a = 4, test.mtime = test.mtime
  </code></pre>
  
  <p>It changed mtime in table test exactly. So, what should I do for this?</p>
  
  <p>------------- EDIT -----------
  It doesn't work, either:</p>
  
  <pre><code>update test
  join middle on test.id = middle.test_id
  join test2 on test2.id = middle.test2.id
  set test.a = 3, test.mtime = test.mtime
  where test2.id = test2.id + 4;      -- after test, set tset2.id = 4 works,
  </code></pre>