Zend certified PHP/Magento developer

How to fix duplicate id’s in multiselect options

Via the api, multi select options were accidentally inserted as duplicates.

So instead of 11111,22222 being stored in catalog_product_entity_text.value it was submitted as 11111,22222,11111,22222 and stored as such.

This causes the indexer to break with duplicate errors.

SQLSTATE[23000]: Integrity constraint violation:    
1062 Duplicate entry '681306-12156-1-7638991-681306' for key 'PRIMARY',   
query was:   
INSERT  INTO `catalog_product_index_eav_temp`    
(`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`)    
VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)......