We found a solution on a corrupted database where we had the same problem with category flat catalog indexation.
The following sql statement helped us (don’t forget to backup your database before executing this !!! and don’t do it on a production installation) :
DELETE
FROM `catalog_category_entity_datetime`
WHERE `catalog_category_entity_datetime`.`attribute_id` NOT IN (
SELECT `eav_attribute`.attribute_id FROM `eav_entity_type`
INNER JOIN `eav_attribute` ON eav_attribute.entity_type_id = eav_entity_type.entity_type_id
WHERE (eav_entity_type.entity_type_code='catalog_category')
);
DELETE
FROM `catalog_category_entity_decimal`
WHERE `catalog_category_entity_decimal`.`attribute_id` NOT IN (
SELECT `eav_attribute`.attribute_id FROM `eav_entity_type`
INNER JOIN `eav_attribute` ON eav_attribute.entity_type_id = eav_entity_type.entity_type_id
WHERE (eav_entity_type.entity_type_code='catalog_category')
);
DELETE
FROM `catalog_category_entity_int`
WHERE `catalog_category_entity_int`.`attribute_id` NOT IN (
SELECT `eav_attribute`.attribute_id FROM `eav_entity_type`
INNER JOIN `eav_attribute` ON eav_attribute.entity_type_id = eav_entity_type.entity_type_id
WHERE (eav_entity_type.entity_type_code='catalog_category')
);
DELETE
FROM `catalog_category_entity_text`
WHERE `catalog_category_entity_text`.`attribute_id` NOT IN (
SELECT `eav_attribute`.attribute_id FROM `eav_entity_type`
INNER JOIN `eav_attribute` ON eav_attribute.entity_type_id = eav_entity_type.entity_type_id
WHERE (eav_entity_type.entity_type_code='catalog_category')
);
DELETE
FROM `catalog_category_entity_varchar`
WHERE `catalog_category_entity_varchar`.`attribute_id` NOT IN (
SELECT `eav_attribute`.attribute_id FROM `eav_entity_type`
INNER JOIN `eav_attribute` ON eav_attribute.entity_type_id = eav_entity_type.entity_type_id
WHERE (eav_entity_type.entity_type_code='catalog_category')
);