Hi,
I am looking for the "cause" behind a deadlock which occur quite frequently. It can be reproduced in the following manner:
CREATE TABLE test (
id bigint(20) NOT NULL auto_increment,
id2 bigint(20) NOT NULL default 0,
str varchar(255) default NULL,
PRIMARY KEY (id),
KEY id2 (id2)
) ;
Insert few records:
INSERT INTO test (id2, str) VALUES (1, 'tim');
INSERT INTO test (id2, str) VALUES (2, 'tom');
INSERT INTO test (id2, str) VALUES (3, 'jim');
INSERT INTO test (id2, str) VALUES (4, 'neo');
INSERT INTO test (id2, str) VALUES (5, 'ken');
Consider two threads T1 and T2 performing the following operations in the sequence specified below:
T1: BEGIN;
T2: BEGIN;
T1: DELETE FROM test WHERE id2 = 2;
T2: DELETE FROM test WHERE id2 = 3;
T1: INSERT INTO test (id2, st
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --