~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2009-01-07 09:27:07 UTC
  • Revision ID: brian@tangent.org-20090107092707-bn67qpdllfcyh3j9
Removing dead field translator code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
13
 
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/lock0lock.ic
 
1
/******************************************************
21
2
The transaction lock system
22
3
 
 
4
(c) 1996 Innobase Oy
 
5
 
23
6
Created 5/7/1996 Heikki Tuuri
24
7
*******************************************************/
25
8
 
38
21
#include "read0read.h"
39
22
#include "log0recv.h"
40
23
 
41
 
/*********************************************************************//**
 
24
/*************************************************************************
42
25
Calculates the fold value of a page file address: used in inserting or
43
 
searching for a lock in the hash table.
44
 
@return folded value */
 
26
searching for a lock in the hash table. */
45
27
UNIV_INLINE
46
28
ulint
47
29
lock_rec_fold(
48
30
/*==========*/
49
 
        ulint   space,  /*!< in: space */
50
 
        ulint   page_no)/*!< in: page number */
 
31
                        /* out: folded value */
 
32
        ulint   space,  /* in: space */
 
33
        ulint   page_no)/* in: page number */
51
34
{
52
35
        return(ut_fold_ulint_pair(space, page_no));
53
36
}
54
37
 
55
 
/*********************************************************************//**
 
38
/*************************************************************************
56
39
Calculates the hash value of a page file address: used in inserting or
57
 
searching for a lock in the hash table.
58
 
@return hashed value */
 
40
searching for a lock in the hash table. */
59
41
UNIV_INLINE
60
42
ulint
61
43
lock_rec_hash(
62
44
/*==========*/
63
 
        ulint   space,  /*!< in: space */
64
 
        ulint   page_no)/*!< in: page number */
 
45
                        /* out: hashed value */
 
46
        ulint   space,  /* in: space */
 
47
        ulint   page_no)/* in: page number */
65
48
{
66
49
        return(hash_calc_hash(lock_rec_fold(space, page_no),
67
50
                              lock_sys->rec_hash));
68
51
}
69
52
 
70
 
/*********************************************************************//**
 
53
/*************************************************************************
71
54
Checks if some transaction has an implicit x-lock on a record in a clustered
72
 
index.
73
 
@return transaction which has the x-lock, or NULL */
 
55
index. */
74
56
UNIV_INLINE
75
57
trx_t*
76
58
lock_clust_rec_some_has_impl(
77
59
/*=========================*/
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) */
 
60
                                /* out: transaction which has the x-lock, or
 
61
                                NULL */
 
62
        const rec_t*    rec,    /* in: user record */
 
63
        dict_index_t*   index,  /* in: clustered index */
 
64
        const ulint*    offsets)/* in: rec_get_offsets(rec, index) */
81
65
{
82
 
        trx_id_t        trx_id;
 
66
        dulint  trx_id;
83
67
 
84
68
        ut_ad(mutex_own(&kernel_mutex));
85
69
        ut_ad(dict_index_is_clust(index));
96
80
        return(NULL);
97
81
}
98
82
 
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 */
 
83
/*************************************************************************
 
84
Gets the heap_no of the smallest user record on a page. */
102
85
UNIV_INLINE
103
86
ulint
104
87
lock_get_min_heap_no(
105
88
/*=================*/
106
 
        const buf_block_t*      block)  /*!< in: buffer block */
 
89
                                        /* out: heap_no of smallest
 
90
                                        user record, or
 
91
                                        PAGE_HEAP_NO_SUPREMUM */
 
92
        const buf_block_t*      block)  /* in: buffer block */
107
93
{
108
94
        const page_t*   page    = block->frame;
109
95