ERROR 1062 (23000): Duplicate entry '113715-303' for key 2
Date: August 22, 2007 08:30AM
We were keeping getting "ERROR 1062 (23000): Duplicate entry '113715-303' for key 2" when inserting a row like below:
INSERT INTO pattern_piece_type (pce_type_id, pat_series_id, exists_ind, pat_pce_type_id, note_id, setup_by_id, setup_dt, updated_by_id, updated_dt) VALUES (303,113715,'N',27791780,null,381,'2007-08-16 11:12:07.0',null,null);
We're using MySQL 5.0.45 community edition runing on Linux RedHat 4.0. Key 2 is a compound unique key on that table. However it's very bizarre given the fact that we know for sure this is NOT a row existing with 303,113715 in that table. How come mysql doesn’t take it? Here is the definition of the table. Any help or comment would be greatly appreciated.
CREATE TABLE `pattern_piece_type` (
`pce_type_id` int(5) default NULL,
`pat_series_id` int(9) default NULL,
`exists_ind` char(1) character set latin1 collate latin1_bin default NULL,
`pat_pce_type_id` bigint(10) NOT NULL,
`note_id` int(9) default NULL,
`setup_by_id` int(5) default NULL,
`setup_dt` datetime default NULL,
`updated_by_id` int(5) default NULL,
`updated_dt` datetime default NULL,
PRIMARY KEY (`pat_pce_type_id`),
UNIQUE KEY `iu_patt_pce_type_seriestype_id` USING BTREE (`pat_series_id`,`pce_type_id`),
KEY `i_pattern_piece_type_srsid` USING BTREE (`pat_series_id`),
KEY `i_pattern_piece_type_typid` USING BTREE (`pce_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |