I get this exception:
Error Code : 1213 Deadlock found when trying to get lock; try restarting transaction
I am running 3 delete statements and 1 update statement in a query window. When i run those queries it throws error code 1213 and deadl开发者_如何学Pythonock exception.
My mysql version is 5.0. Please share your views.
Thanks.
A single transaction cannot cause a deadlock. I'm not sure what you mean by a "query window", but if you are running all of those statements on a single connection/transaction, then there is something else that is holding the locks that your statements need.
SHOW ENGINE INNODB STATUS can show you what locks are being held by different connections.
精彩评论