Primary Key conflict table but finding out the conflict record

Duplicate entry '5858888-1' for key ' PRIMARY'
This is a problem encountered during an update operation.
update update a few fields, does not involve field primary key related.
Why primary key violation will be reported?
Follow the prompts to check the data in the table, but did not prompt '5858888-1' record corresponding to find, that the table does not record information corresponding to the error!
There is something of a supernatural event.
The SQL apart, one by one field updates, each of which can execute successfully, the fight would have failed to perform together.
Pou information check the table a few times, did not find a clue.
Later, checked the table associated with the trigger, there was a clue in the trigger, this time to update Table A in synchronization updates another table B, and the same goes another table's primary key B and Table A structure, at the same time, because there are many conditions, it created a field by field can succeed in time to perform the update, update to fight together on problems of failure.
Trigger is to blame, no, it should be said that the use of non-standard mysql are to blame.
After locating the problem to solve the like, combined with the data situation, the primary key is to amend the constitution, and clear up some useless index.
Mend, I'm a Tinker.

Stored procedures and triggers try not to write, follow-up maintenance personnel will cause great distress.

Sometimes the problem has been positioned not, do not worry, Fu master, then Fu from, things will get resolved.

! ...... # ¥% &

@ () for a year I did not write the article, and the occasion to write again time to celebrate the recovery of their own, and threw a flower. ...... *** ......

Published 105 original articles · won praise 58 · views 410 000 +

Guess you like

Origin blog.csdn.net/ljl890705/article/details/90035314