~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/lock0lock.ic

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file include/lock0lock.ic
20
21
The transaction lock system
21
22
 
22
23
Created 5/7/1996 Heikki Tuuri
37
38
#include "read0read.h"
38
39
#include "log0recv.h"
39
40
 
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 */
43
45
UNIV_INLINE
44
46
ulint
45
47
lock_rec_fold(
46
48
/*==========*/
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 */
50
51
{
51
52
        return(ut_fold_ulint_pair(space, page_no));
52
53
}
53
54
 
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 */
57
59
UNIV_INLINE
58
60
ulint
59
61
lock_rec_hash(
60
62
/*==========*/
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 */
64
65
{
65
66
        return(hash_calc_hash(lock_rec_fold(space, page_no),
66
67
                              lock_sys->rec_hash));
67
68
}
68
69
 
69
 
/*************************************************************************
 
70
/*********************************************************************//**
70
71
Checks if some transaction has an implicit x-lock on a record in a clustered
71
 
index. */
 
72
index.
 
73
@return transaction which has the x-lock, or NULL */
72
74
UNIV_INLINE
73
75
trx_t*
74
76
lock_clust_rec_some_has_impl(
75
77
/*=========================*/
76
 
                                /* out: transaction which has the x-lock, or
77
 
                                NULL */
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) */
81
81
{
82
 
        dulint  trx_id;
 
82
        trx_id_t        trx_id;
83
83
 
84
84
        ut_ad(mutex_own(&kernel_mutex));
85
85
        ut_ad(dict_index_is_clust(index));
96
96
        return(NULL);
97
97
}
98
98
 
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 */
101
102
UNIV_INLINE
102
103
ulint
103
104
lock_get_min_heap_no(
104
105
/*=================*/
105
 
                                        /* out: heap_no of smallest
106
 
                                        user record, or
107
 
                                        PAGE_HEAP_NO_SUPREMUM */
108
 
        const buf_block_t*      block)  /* in: buffer block */
 
106
        const buf_block_t*      block)  /*!< in: buffer block */
109
107
{
110
108
        const page_t*   page    = block->frame;
111
109