=== modified file 'storage/innodb_plugin/lock/lock0lock.c' --- storage/innodb_plugin/lock/lock0lock.c 2009-10-09 14:13:15 +0000 +++ storage/innodb_plugin/lock/lock0lock.c 2009-12-04 18:13:11 +0000 @@ -3341,6 +3341,9 @@ bit_no = lock_rec_find_set_bit(wait_lock); ut_a(bit_no != ULINT_UNDEFINED); + + lock = lock_rec_get_first_on_page_addr(wait_lock->un_member.rec_lock.space, + wait_lock->un_member.rec_lock.page_no); } /* Look at the locks ahead of wait_lock in the lock queue */ @@ -3354,10 +3357,11 @@ ut_ad(lock_get_type_low(lock) == LOCK_REC); ut_a(bit_no != ULINT_UNDEFINED); - lock = (lock_t*) lock_rec_get_prev(lock, bit_no); + lock = (lock_t*) lock_rec_get_next(bit_no, lock); } - if (lock == NULL) { + /* reached the original lock in the queue */ + if (lock == wait_lock) { /* We can mark this subtree as searched */ trx->deadlock_mark = 1;