title: Force InnoDB to recheck foreign keys on a table/tables?
body: <p>I have  a set of <code>InnoDB</code> tables that I periodically need to maintain by removing some rows  and inserting others.  Several of the tables have foreign key constraints referencing other tables, so this means that the table loading order is important.  To insert the new rows without worrying about the order of the tables, I use:</p>
  
  <pre><code>SET FOREIGN_KEY_CHECKS=0;
  </code></pre>
  
  <p>before, and then:</p>
  
  <pre><code>SET FOREIGN_KEY_CHECKS=1;
  </code></pre>
  
  <p>after.  </p>
  
  <p>When the loading is complete, I'd like to check that the data in the updated tables still hold referential integrity--that the new rows don't break foreign key constraints--but it seems that there's no way to do this.</p>
  
  <p>As a test, I entered data that I was sure violated foreign key constraints, and upon re-enabling the foreign key checks, mysql produced no warnings or errors.</p>
  
  <p>If I tried to find a way to specify the table loading order, and left the foreign key checks on during the loading process, this would not allow me to load data in a table that has a self-referencing foreign key constraint, so this would not be an acceptable solution.</p>
  
  <p>Is there any way to force InnoDB to verify a table's or a database's foreign key constraints?</p>