Table with unique constraint has duplicate records (MySQL 5.1.57)
问题 I recently ran into a quite puzzling situation. In a table which has a unique constraint set on 2 fields, there are many existing records that violate this constraint! And the main question is: How could they have gotten there in the first place, with the unique constraint already in place? Schema: CREATE TABLE `rest_service_mediafile` ( `id` int(11) NOT NULL AUTO_INCREMENT, `video_id` int(11) NOT NULL, `video_encoding_id` int(11) NOT NULL, `external_id` int(11) DEFAULT NULL, PRIMARY KEY (`id