title: MySql Infinite Loop
body: <p>I am somewhat inexperience with MySQL so please excuse my naivety.</p>
  
  <p>I am trying to merge two tables according to an ISR id number and then insert that data into another table, adr.  I am running a SQL query on a MySQL database in Workbench 5.2 and my query takes less than a second if I limit my code as follows:</p>
  
  <pre><code>TRUNCATE adr;
  
  INSERT into adr
  (SELECT drug08q1.isr, drug08q1.drugname, reac08q1.pt 
  FROM drug08q1
  INNER JOIN reac08q1
  ON drug08q1.isr = reac08q1.isr LIMIT 0,2815);
  
  SELECT * FROM adr;
  </code></pre>
  
  <p>If I increment the limit to:</p>
  
  <pre><code>LIMIT 0,20816
  </code></pre>
  
  <p>The SQL will say it's running forever and never finish.  I have no idea why incrementing the LIMIT beyond some random threshold will result in an infinite loop.  What could I be doing incorrectly?</p>
  
  <p>Thank you in advance!</p>