MySQL Forums
Forum List  »  French

Deadlock au lieu d avoir une attente
Posted by: Bob Bobby
Date: May 29, 2008 05:02PM

Bonsoir,

Je ne comprend pas une chose. J utilise PDO pour PHP et lorsqu'un process fait une transaction et qu'il modifie une table, celle ci se trouve vérouillée.
Si un second process essaie de modifier cette table en meme temps, j obtiens un deadlock plutot qu'une attente, c'est étrange.
Est ce normal ?

Pour info voici le message obtenu avec show innodb status:

when i type "show innodb status" i got the following message:
For information i am using PDO driver.

------------------------
LATEST DETECTED DEADLOCK
------------------------
080529 23:15:05
*** (1) TRANSACTION:
TRANSACTION 0 192218, ACTIVE 1 sec, OS thread id 162212864 inserting
mysql tables in use 1, locked 1
LOCK WAIT 5 lock struct(s), heap size 1024, undo log entries 1
MySQL thread id 43306083, query id 434319583 localhost USER update
insert into tableyyy (a,b) values('1212095704','10')
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 1888 n bits 1112 index `FK_xxxxx` of table `BDD/tableyyyyy` trx id 0 192218 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 4 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 4; hex 0000000b; asc ;; 1: len 6; hex 000000003d73; asc =s;;

*** (2) TRANSACTION:
TRANSACTION 0 192217, ACTIVE 5 sec, OS thread id 194003456 fetching rows, thread declared inside InnoDB 475
mysql tables in use 1, locked 1
402 lock struct(s), heap size 44352, undo log entries 3826
MySQL thread id 43306046, query id 434319627 localhost user updating
delete from table_yyyy where a<='1211925600'
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 1888 n bits 1112 index `FK_xxxxx` of table `BDD/tableyyyy` trx id 0 192217 lock mode S
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;

Record lock, heap no 2 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 4; hex 0000000a; asc ;; 1: len 6; hex 000000003d71; asc =q;;

Record lock, heap no 3 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 4; hex 00000010; asc ;; 1: len 6; hex 000000003d72; asc =r;;


D avance merci pour vos réponses

Options: ReplyQuote


Subject
Views
Written By
Posted
Deadlock au lieu d avoir une attente
4379
May 29, 2008 05:02PM


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.