------------------
---lock strcut(1):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
TABLE LOCK table `test`.`testlll` trx id 322808 lock mode IX
---lock strcut(2):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
RECORD LOCKS space id 434 page no 3 n bits 96 index PRIMARY of table `test`.`testlll` trx id 322808 lock_mode X(LOCK_X) locks rec but not gap(LOCK_REC_NOT_GAP) waiting(LOCK_WAIT)
Record lock, heap no 25 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
0: len 4; hex 80000019; asc ;;
1: len 6; hex 00000004ecf9; asc ;;
2: len 7; hex f0000001f90110; asc ;;
3: len 7; hex 67616f70656e67; asc gaopeng;;
---lock strcut(3):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
RECORD LOCKS space id 434 page no 3 n bits 96 index PRIMARY of table `test`.`testlll` trx id 322808 lock_mode X(LOCK_X) locks rec but not gap(LOCK_REC_NOT_GAP)
Record lock, heap no 20 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
0: len 4; hex 80000018; asc ;;
1: len 6; hex 00000004ecf8; asc ;;
2: len 7; hex ef000001f80110; asc ;;
3: len 7; hex 67616f70656e67; asc gaopeng;;
情况2
update
update
TX1: TX2:
update testlll set where id=22;
update testlll set where id=25;
update testlll set where id=25;(堵塞)
update testlll set where id=22;(堵塞)
死锁
这种情况比较简单不打印出锁结构
情况3
insert
insert
TX1: TX2:
insert into testlll values(26,'gaopeng');
insert into testlll values(27,'gaopeng');
nsert into testlll values(27,'gaopeng');(堵塞)
insert into testlll values(26,'gaopeng');(堵塞)
死锁
锁结构:
---TRANSACTION 422212176315800, not started
0 lock struct(s), heap size 1160, 0 row lock(s)
---TRANSACTION 323284, ACTIVE 10 sec inserting
mysql tables in use 1, locked 1
3 lock struct(s), heap size 1160, 2 row lock(s), undo log entries 1
MySQL thread id 2, OS thread handle 140734663980800, query id 369 localhost root update
insert into testlll values(26,'gaopeng')
---lock strcut(1):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
TABLE LOCK table `test`.`testlll` trx id 323284 lock mode IX
---lock strcut(2):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
RECORD LOCKS space id 434 page no 3 n bits 96 index PRIMARY of table `test`.`testlll` trx id 323284 lock_mode X(LOCK_X) locks rec but not gap(LOCK_REC_NOT_GAP)
Record lock, heap no 27 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
0: len 4; hex 8000001b; asc ;;
1: len 6; hex 00000004eed4; asc ;;
2: len 7; hex d3000002a10110; asc ;;
3: len 7; hex 67616f70656e67; asc gaopeng;;
---lock strcut(3):(Add by gaopeng) In modify Version I force check all REC_LOCK/TAB_LOCK for this Trx
RECORD LOCKS space id 434 page no 3 n bits 96 index PRIMARY of table `test`.`testlll` trx id 323284 lock mode S(LOCK_S) locks rec but not gap(LOCK_REC_NOT_GAP) waiting(LOCK_WAIT)
Record lock, heap no 26 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
0: len 4; hex 8000001a; asc ;;
1: len 6; hex 00000004eed3; asc ;;
2: len 7; hex d2000002330110; asc 3 ;;
3: len 7; hex 67616f70656e67; asc gaopeng;;