Bug #481 error 'Duplicate entry '
Submitted: 22 May 2003 21:57 Modified: 23 Jun 2003 8:11
Reporter: Shine Varghese Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version: OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[22 May 2003 21:57] Shine Varghese
Description:
I have a table structure like the following.

+------------------------+-----------+------+-----+---------+----------------+
| Field                  | Type      | Null | Key | Default | Extra          |
+------------------------+-----------+------+-----+---------+----------------+
| file_id                | int(11)   |      | PRI | NULL    | auto_increment |
| file_name              | char(50)  | YES  |     | NULL    |                |
| file_physicalfile_name | char(100) | YES  |     | NULL    |                |
| file_added_dt          | datetime  | YES  |     | NULL    |                |
| file_client_id         | char(35)  | YES  |     | NULL    |                |
| file_pt_id             | int(11)   | YES  |     | NULL    |                |
| file_practitioner_id   | char(35)  | YES  |     | NULL    |                |
| file_dateofservice     | date      | YES  |     | NULL    |                |
| file_refno             | char(50)  | YES  |     | NULL    |                |
| file_size              | int(12)   | YES  |     | NULL    |                |
| file_extension         | char(3)   | YES  |     | NULL    |                |
| file_docaccess         | char(1)   | YES  |     | NULL    |                |
| file_content_type      | char(20)  | YES  |     | NULL    |                |
| file_additional_dt     | date      | YES  |     | NULL    |                |
| file_uploadby          | char(35)  | YES  |     | NULL    |                |
| file_memo              | char(240) | YES  |     | NULL    |                |
| file_icd               | char(240) | YES  |     | NULL    |                |
| file_owner             | char(1)   |      |     |         |                |
+------------------------+-----------+------+-----+---------+----------------+

Some times i get the following error message on slave status.

error 'Duplicate entry '14713-i' for key 1' on query 'insert into
files_info(file_name,file_physicalfile_name,file_added_dt,file_memo
file_refno,file_practitioner_id,file_pt_id,file_extension,file_docaccess
file_uploadby,file_dateofservice,file_size,file_owner,file_client_id)
values("CATHERINEOVERTONJONES233557N1.doc","CATHERINEOVERTONJONES233557N1
doc","2003-05-22 09:17:24","","", "hoact","4054","doc","a","hemoncCTcl","--"
"45056",'i','hemoncctcl')' 

How to repeat:
[23 May 2003 7:59] Indrek Siitan
Your bug report does not contain enough information for us to repeat it.

Is the DESC output from master or slave? From the DESC output it looks like you only have one 
index on the table, and that is the primary key on the file_id field, but the error message indicates 
that there's a composite index on file_id and file_owner ('14713-i' - 'i' you are inserting into the 
file_owner field). Are you sure your table structure on master and slave is in sync?
[23 May 2003 8:11] Indrek Siitan
Ok, it actually turns out that the DESC output doesn't necessarily show all the indexes. Can you 
give us 'SHOW CREATE TABLE files_info' and 'SHOW INDEXES FROM files_info' output on both the 
master and the slave?
[14 Feb 2005 22:51] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".