title: CREATE TABLE fails despite preceding DROP TABLE statement
body: <p>I am attempting to support another developer's CodeIgniter framework php which uses mysql. </p>
  
  <p>The code does the following (among other things before and after):</p>
  
  <pre><code>$sql_case_00_4 = "DROP TABLE IF EXISTS top_domains_video_image_audio_detected";
  $this-&gt;db-&gt;query($sql_case_00_4);
  
  $sql_case_00_5 = "CREATE TABLE top_domains_video_image_audio_detected (domain_name varchar(255),genId varchar (12),trackingId int)";
  $this-&gt;db-&gt;query($sql_case_00_5);
  </code></pre>
  
  <p>On occasion mysql generates the following error which we log: "Query error: Table 'top_domains_video_image_audio_detected' already exists". This is the only place in the code where the table is being generated (or used at all really).</p>
  
  <p>One possibility I was thinking was that a race condition could occur if two requests attempted to create the table at the same time. </p>
  
  <p>But that seems rare as there aren't many who are querying this server, unless perhaps two back-to-back actions by the same user could cause two simultaneous requests.</p>
  
  <p>I'm not 100% sure, but I am guessing that the query() function does block, thus preventing CREATE from being called during the DROP.</p>
  
  <p>Is there another possibility here that could cause this?</p>