您的位置:首页 > 其它

函数lock_rec_find_similar_on_page

2015-11-06 15:01 176 查看
/*********************************************************************//**
Looks for a suitable type record lock struct by the same trx on the same page.
This can be used to save space when a new record lock should be set on a page:
no new struct is needed, if a suitable old is found.
@return    lock or NULL */
UNIV_INLINE
lock_t*
lock_rec_find_similar_on_page(
/*==========================*/
ulint        type_mode,    /*!< in: lock type_mode field */
ulint        heap_no,    /*!< in: heap number of the record */
lock_t*        lock,        /*!< in: lock_rec_get_first_on_page() */
const trx_t*    trx)        /*!< in: transaction */
{
ut_ad(mutex_own(&kernel_mutex));

while (lock != NULL) {
if (lock->trx == trx
&& lock->type_mode == type_mode
&& lock_rec_get_n_bits(lock) > heap_no) {

return(lock);
}

lock = lock_rec_get_next_on_page(lock);
}

return(NULL);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: