title: MySQL Error Code: 1205. Lock wait timeout during update with inner join
body: <p>I am trying to update the <code>Time_Stamp</code> field in my table, <code>simple_pack_data</code>, to match the values in the similarly titled field in my <code>temp_data</code> table. The tables each have fields called <code>Test_Number</code> and <code>Time_Marker</code>, which I'm using to <code>INNER JOIN</code> the tables. <code>Time_Marker</code> is like a reading count, where <code>Time_Stamp</code> is an actual time from the start of the test. </p>
  
  <p>I want to update the <code>Time_Stamp</code> one test at a time, so the code I have been trying is: </p>
  
  <pre><code>UPDATE simple_pack_data s
  INNER JOIN (
      SELECT *
      FROM temp_data t
      WHERE t.Test = "3"
      ) AS tmp
  ON s.Test_Number = tmp.Test_Number AND s.Time_Marker = tmp.Time_Marker
  SET s.Time_Stamp = tmp.Time_Stamp
  WHERE s.Test_Number = "3";
  </code></pre>
  
  <p>When I run this it takes over 50 seconds and I get the 1205 error. If I run a similarly structured select statement:</p>
  
  <pre><code>SELECT *
  FROM simple_pack_data s
  INNER JOIN (
      SELECT *
      FROM temp_data t
      WHERE t.Test = "3"
      ) AS tmp
  ON s.Test_Number = tmp.Test AND s.Time_Marker = tmp.Time_Marker
  WHERE s.Test_Number = "3";
  </code></pre>
  
  <p>It takes much less than a second and I know join is working fine. Is the update really taking that long? If so, is there any way to change the timeout value so it can get through it?</p>