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?
4488
January 06, 2005 12:32PM
3048
January 07, 2005 03:30PM
2931
January 07, 2005 03:36PM
3366
January 07, 2005 10:55PM
3011
January 10, 2005 05:08PM
3082
January 11, 2005 10:35AM
3308
January 12, 2005 09:56AM
2995
January 12, 2005 04:46PM
3689
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.