MySQL Forums
Forum List  »  InnoDB

SAVEPOINTs and deadlocks
Posted by: Jørn Stamnes
Date: June 19, 2018 02:00AM

I'm struggelig with a problem related to handeling deadlocks.

In a PHP script I do a lot of updates to different InnoDb tables. Basically I do:

START TRANSACTION
do several SELECT, INSERT, DELETE and UPDATES
SAVEPOINT an_identifier
DELETE ...
INSERT ...
RELEASE SAVEPOINT
more SELECT, INSERT, DELETE AND UPDATES
COMMIT

Sometime I get a deadlock when doing the DELETE statement right after the SAVEPOINT. And sometime it seems like only the DELETE statement is rolled back, but other times after the START TRANSACTION is rolled back.

So my question is, when a deadlock is detected inside/after a SAVEPOINT has been set, should not the rollback done by MySQL be to the start of the SAVEPOINT?

Have I missed something?

Options: ReplyQuote


Subject
Views
Written By
Posted
SAVEPOINTs and deadlocks
2547
June 19, 2018 02:00AM
1288
June 19, 2018 02:44AM
1078
June 19, 2018 12:08PM
1154
June 20, 2018 04:31AM
1122
June 20, 2018 09:56AM
1045
June 21, 2018 12:19AM
906
June 21, 2018 09:42AM
892
June 22, 2018 12:52AM
894
June 22, 2018 08:11AM
1040
June 26, 2018 01:33AM
944
June 26, 2018 07:34AM
1008
June 27, 2018 07:05AM
941
June 27, 2018 08:02AM
1009
June 27, 2018 11:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.