title: Unlocking tables if thread is lost
body: <p><a href="http://dev.mysql.com/doc/refman/5.0/en/internal-locking.html">http://dev.mysql.com/doc/refman/5.0/en/internal-locking.html</a></p>
  
  <p>The following is the extract from the documentation.</p>
  
  <pre><code>mysql&gt; LOCK TABLES real_table WRITE, temp_table WRITE;
  mysql&gt; INSERT INTO real_table SELECT * FROM temp_table;
  mysql&gt; DELETE FROM temp_table;
  mysql&gt; UNLOCK TABLES;
  </code></pre>
  
  <p>My question is that if I use this logic in the shell script code, and if the thread is lost (not killed) before it reaches "unlock tables" statement, how will I know that some tables are locked and how do I unlock tables manually?</p>