1
/******************************************************
2
The transaction lock system
6
Created 5/7/1996 Heikki Tuuri
7
*******************************************************/
11
#include "dict0dict.h"
16
#include "page0page.h"
21
#include "read0read.h"
24
/*************************************************************************
25
Calculates the fold value of a page file address: used in inserting or
26
searching for a lock in the hash table. */
31
/* out: folded value */
32
ulint space, /* in: space */
33
ulint page_no)/* in: page number */
35
return(ut_fold_ulint_pair(space, page_no));
38
/*************************************************************************
39
Calculates the hash value of a page file address: used in inserting or
40
searching for a lock in the hash table. */
45
/* out: hashed value */
46
ulint space, /* in: space */
47
ulint page_no)/* in: page number */
49
return(hash_calc_hash(lock_rec_fold(space, page_no),
53
/*************************************************************************
54
Checks if some transaction has an implicit x-lock on a record in a clustered
58
lock_clust_rec_some_has_impl(
59
/*=========================*/
60
/* out: transaction which has the x-lock, or
62
rec_t* rec, /* in: user record */
63
dict_index_t* index, /* in: clustered index */
64
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
68
ut_ad(mutex_own(&kernel_mutex));
69
ut_ad(index->type & DICT_CLUSTERED);
70
ut_ad(page_rec_is_user_rec(rec));
72
trx_id = row_get_rec_trx_id(rec, index, offsets);
74
if (trx_is_active(trx_id)) {
75
/* The modifying or inserting transaction is active */
77
return(trx_get_on_id(trx_id));