mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-35708 lock_rec_get_prev() returns only the first record lock
It's supposed that the function gets the previous lock set on a record. But if there are several locks set on a record, it will return only the first one. Continue locks list iteration till the certain lock even if the certain bit in lock bitmap is set.
This commit is contained in:
parent
07b77e862c
commit
06169358d5
1 changed files with 3 additions and 2 deletions
|
@ -984,13 +984,14 @@ lock_rec_get_prev(
|
|||
ut_ad(!in_lock->is_table());
|
||||
const page_id_t id{in_lock->un_member.rec_lock.page_id};
|
||||
hash_cell_t *cell= lock_sys.hash_get(in_lock->type_mode).cell_get(id.fold());
|
||||
lock_t *prev_lock= nullptr;
|
||||
|
||||
for (lock_t *lock= lock_sys_t::get_first(*cell, id); lock != in_lock;
|
||||
lock= lock_rec_get_next_on_page(lock))
|
||||
if (lock_rec_get_nth_bit(lock, heap_no))
|
||||
return lock;
|
||||
prev_lock= lock;
|
||||
|
||||
return nullptr;
|
||||
return prev_lock;
|
||||
}
|
||||
|
||||
/*============= FUNCTIONS FOR ANALYZING RECORD LOCK QUEUE ================*/
|
||||
|
|
Loading…
Add table
Reference in a new issue