title: Magento and error 1452 (Integrity constraint violation) on reindex catalog
body: <p>Magento is refusing to reindex my product catalog. It's logging this error:</p>
  
  <pre><code>2013-01-29T23:24:51+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: 
  Integrity constraint violation: 1452 Cannot add or update a child row: 
  a foreign key constraint fails (`cjsquash_mgnt1`.`catalog_category_product_index`, 
  CONSTRAINT `FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`))
  </code></pre>
  
  <p>Which I would think means there's an invalid row in catalog_category_product_index with a missing value in the catalog_category_entity table, but I ran this query:</p>
  
  <pre><code>SELECT *
  FROM catalog_category_product_index
  where category_id not in (select entity_id from 
  catalog_category_entity)
  </code></pre>
  
  <p>and it returns 0 rows so that doesn't appear to be the case. What can I do to fix this?</p>