

#My sql deadlock found update#
The problem (as you seem to grasp) is that a thread updating an index can deadlock against another thread that updates an index (and remember, InnoDB tables are indexes with leaf-nodes containing the row data). The operation has entered a lock queue 3. A deadlock can occur when transactions lock rows in multiple tables (through statements such as UPDATE or SELECT.

The first update, from Client B, can now proceed. MS SQL Server has been known to have similar problems in some cases and workloads. mysql> UPDATE Birds SET value40 WHERE nameBuzzard ERROR 1213 (40001): Deadlock found when trying to get lock try restarting transaction InnoDB rolls back the transaction that caused the deadlock. I assume based on your question that the update statement, however, is in its own transaction and therefore there are no complex interdependencies among writes from a logical database perspective.Ĭertain multi-threaded databases (including MySQL) can have single statements deadlock against themselves due to write dependencies within threads on the same query. When dealing with deadlocks, the first thing to do, always, is to see whether you have complex transactions deadlocking against eachother.
