17
17
*****************************************************************************/
19
/******************************************************
19
/**************************************************//**
20
@file include/lock0lock.ic
20
21
The transaction lock system
22
23
Created 5/7/1996 Heikki Tuuri
37
38
#include "read0read.h"
38
39
#include "log0recv.h"
40
/*************************************************************************
41
/*********************************************************************//**
41
42
Calculates the fold value of a page file address: used in inserting or
42
searching for a lock in the hash table. */
43
searching for a lock in the hash table.
44
@return folded value */
47
/* out: folded value */
48
ulint space, /* in: space */
49
ulint page_no)/* in: page number */
49
ulint space, /*!< in: space */
50
ulint page_no)/*!< in: page number */
51
52
return(ut_fold_ulint_pair(space, page_no));
54
/*************************************************************************
55
/*********************************************************************//**
55
56
Calculates the hash value of a page file address: used in inserting or
56
searching for a lock in the hash table. */
57
searching for a lock in the hash table.
58
@return hashed value */
61
/* out: hashed value */
62
ulint space, /* in: space */
63
ulint page_no)/* in: page number */
63
ulint space, /*!< in: space */
64
ulint page_no)/*!< in: page number */
65
66
return(hash_calc_hash(lock_rec_fold(space, page_no),
66
67
lock_sys->rec_hash));
69
/*************************************************************************
70
/*********************************************************************//**
70
71
Checks if some transaction has an implicit x-lock on a record in a clustered
73
@return transaction which has the x-lock, or NULL */
74
76
lock_clust_rec_some_has_impl(
75
77
/*=========================*/
76
/* out: transaction which has the x-lock, or
78
const rec_t* rec, /* in: user record */
79
dict_index_t* index, /* in: clustered index */
80
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
78
const rec_t* rec, /*!< in: user record */
79
dict_index_t* index, /*!< in: clustered index */
80
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
84
84
ut_ad(mutex_own(&kernel_mutex));
85
85
ut_ad(dict_index_is_clust(index));
99
/*************************************************************************
100
Gets the heap_no of the smallest user record on a page. */
99
/*********************************************************************//**
100
Gets the heap_no of the smallest user record on a page.
101
@return heap_no of smallest user record, or PAGE_HEAP_NO_SUPREMUM */
103
104
lock_get_min_heap_no(
104
105
/*=================*/
105
/* out: heap_no of smallest
107
PAGE_HEAP_NO_SUPREMUM */
108
const buf_block_t* block) /* in: buffer block */
106
const buf_block_t* block) /*!< in: buffer block */
110
108
const page_t* page = block->frame;