MySQL Forums
Forum List  »  InnoDB

Is this normal?
Posted by: Björn Danielsson
Date: January 06, 2005 12:32PM

My mysqld (4.0.20 on slackware 10) gets a deadlock in the following simple case:

1.mysql> set autocommit=0;

2.mysql> set autocommit=0;

1.mysql> select * from T where C = 42 for update;

2.mysql> select * from T where C = 42 for update;

1.mysql> insert into T set C = 42;

ERROR 1213: Deadlock found when trying to get lock; Try restarting transaction

This is on an empty table T with a single column C.
Table created by:

create table T (C int not null primary key) type=InnoDB;

Is this normal? Why is there a deadlock here? The second select blocks,
which suggests that the "phantom record" C = 42 is locked correctly,
so I don't understand why the insert fails.

Options: ReplyQuote


Subject
Views
Written By
Posted
Is this normal?
3753
January 06, 2005 12:32PM
2671
January 07, 2005 03:30PM
2559
January 07, 2005 03:36PM
2898
January 07, 2005 10:55PM
2649
January 10, 2005 05:08PM
2624
January 11, 2005 10:35AM
2870
January 12, 2005 09:56AM
2660
January 12, 2005 04:46PM
2907
January 12, 2005 05:36PM


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.