MySQL Forums
Forum List  »  InnoDB

Re: Deadlock Priority
Posted by: Nicolas Cannasse
Date: January 23, 2006 04:42AM

That didn't do it.

My transaction is the following :

START TRANSACTION;

DROP TABLE IF EXISTS Ranks;

CREATE TABLE Ranks
(pos INT NOT NULL AUTO_INCREMENT,PRIMARY KEY (pos)) TYPE=InnoDB
SELECT User.id as uid , User.name as name, score, COUNT(Dino.id) as dcount
FROM User,Dino
WHERE
Dino.owner = User.id AND
User.deleted = 0
GROUP BY User.id
ORDER BY score DESC, User.id ASC;

ALTER TABLE Ranks ADD INDEX uid (uid);

COMMIT;

Sometimes I get an errno 121 (can't create table Ranks) but most of the times I get a deadlock. I tried to create a Tmp TABLE and insert a few thousands elements inside the transaction but it didn't work (still deadlock) :

CREATE TABLE Tmp (name VARCHAR(50) NOT NULL) SELECT name FROM Log;

Options: ReplyQuote


Subject
Views
Written By
Posted
5627
January 19, 2006 04:39AM
2038
January 20, 2006 07:19PM
Re: Deadlock Priority
1889
January 23, 2006 04:42AM
1939
January 23, 2006 05:24AM
1800
January 23, 2006 09:05AM
1819
January 25, 2006 02:53AM


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.