title: Mysql table lock aliasing not working
body: <p>I have a scheduling table which I need to lock then read from. I am currently trying to do this:</p>
  
  <pre><code>LOCK TABLES db.schedule AS j_read READ;
  
  SELECT * FROM db.schedule as j_read;
  
  UNLOCK TABLES;
  </code></pre>
  
  <p>When I run this I get the error: </p>
  
  <blockquote>
    <p>Error Code: 1100. Table 'j_read' was not locked with LOCK TABLES</p>
  </blockquote>
  
  <p>I've gone over the mysql table locks documentation <a href="http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html" rel="nofollow noreferrer">mysql docs</a> but i cant figure our why this is not working for me. if i don't alias anything it works like this</p>
  
  <pre><code>LOCK TABLES db.schedule READ;
  
  SELECT * FROM db.schedule;
  
  UNLOCK TABLES;
  </code></pre>
  
  <p>Any ideas why this is not working or how to do this properly?</p>