Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

SAVEPOINTs and deadlocks (1 reply)

$
0
0
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?

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>