----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 7514, signal count 6804
Mutex spin waits 0, rounds 342390, OS waits 4631
RW-shared spins 3504, OS waits 1430; RW-excl spins 5901, OS waits 1243
------------------------
LATEST DETECTED DEADLOCK
------------------------
100722 17:33:14
*** (1) TRANSACTION:
TRANSACTION 0 489740406, ACTIVE 1 sec, process no 16088, OS thread id 1173543232 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 368, 1 row lock(s)
MySQL thread id 59, query id 5486250 127.0.0.1 webgame.server Updating
UPDATE T_CITY   SET POPULATION_FREE=64 ,POPULATION_TOTAL=240 WHERE CITY_ID=4665
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 7491 n bits 208 index `PRIMARY` of table `war_32dllh`.`t_city` trx id 0 489740406 lock_mode X locks rec but not gap waiting
Record lock, heap no 77 PHYSICAL RECORD: n_fields 21; compact format; info bits 0
0: len 4; hex 80001239; asc    9;; 1: len 6; hex 00001d2fe71e; asc    /  ;; 2: len 7; hex 000000230d1300; asc    #   ;; 3: len 4; hex 80001239; asc    9;; 4: len 4; hex 8000019e; asc     ;; 5: len 4; hex 8000019e; asc     ;; 6: len 4; hex 80000001; asc     ;; 7: len 6; hex 373837383738; asc 787878;; 8: len 4; hex 80000000; asc     ;; 9: len 8; hex 800000000000004c; asc        L;; 10: len 8; hex 8000000000000054; asc        T;; 11: len 8; hex 800000000000002c; asc        ,;; 12: len 8; hex 80000000000000dc; asc         ;; 13: len 8; hex 8000000000000136; asc        6;; 14: len 4; hex 80000000; asc     ;; 15: len 4; hex 8000000a; asc     ;; 16: len 4; hex 8000005a; asc    Z;; 17: SQL NULL; 18: SQL NULL; 19: len 4; hex 80000001; asc     ;; 20: len 8; hex 8000124810675ffa; asc    H g_ ;;*** (2) TRANSACTION:
TRANSACTION 0 489731391, ACTIVE 99 sec, process no 16088, OS thread id 1175140672 starting index read, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
209 lock struct(s), heap size 30704, 11139 row lock(s), undo log entries 62
MySQL thread id 87, query id 5486868 127.0.0.1 webgame.server Updating
UPDATE T_CITY SET POPULATION_FREE=64,POPULATION_TOTAL=240 WHERE CITY_ID=4665
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 7491 n bits 208 index `PRIMARY` of table `war_32dllh`.`t_city` trx id 0 489731391 lock mode S locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 21; compact format; info bits 0T_CITY 表的city_id为主键发生死锁,但怎么两个事务死在了同一个update里,而且还都是行锁?分析了很长时间,没想通,期待大牛帮忙分析一下!