title: What is the result of a mysql SELECT query on a table already LOCKED (write) by another session?
body: <p>Everything is in the title...</p>
  
  <p>If I use:</p>
  
  <pre><code>LOCK TABLE tableA WRITE
  commands
  UNLOCK TABLES
  </code></pre>
  
  <p>What happen if another session/user tries to make a SELECT query on this table?
  I can't find it in the mysql documentation...</p>
  
  <p>Will mysql respond with an error kind of "Error xxx this table is locked! retry later" or will mysql automatically wait until the table is unlocked? How long? Will mysql respond a timeout error if the table stay locked for a long time?</p>
  
  <p>btw I also wonder if this case could happen:</p>
  
  <pre><code>LOCK TABLE tableA WRITE
  </code></pre>
  
  <p>and then php/mysql crashes </p>
  
  <p>and so tableA stay LOCKED 'FOREVER' until mysql receive an UNLOCK TABLES command.</p>