1
/*****************************************************************************
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
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.
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.
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., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/******************************************************
20
Lock module internal structures and methods.
22
Created July 12, 2007 Vasil Dimov
23
*******************************************************/
28
#ifndef LOCK_MODULE_IMPLEMENTATION
29
/* If you need to access members of the structures defined in this
30
file, please write appropriate functions that retrieve them and put
31
those functions in lock/ */
32
#error Do not include lock0priv.h outside of the lock/ module
36
#include "dict0types.h"
37
#include "hash0hash.h"
38
#include "trx0types.h"
42
typedef struct lock_table_struct lock_table_t;
43
struct lock_table_struct {
44
dict_table_t* table; /* database table in dictionary
46
UT_LIST_NODE_T(lock_t)
47
locks; /* list of locks on the same
51
/* Record lock for a page */
52
typedef struct lock_rec_struct lock_rec_t;
53
struct lock_rec_struct {
54
ulint space; /* space id */
55
ulint page_no; /* page number */
56
ulint n_bits; /* number of bits in the lock
57
bitmap; NOTE: the lock bitmap is
58
placed immediately after the
64
trx_t* trx; /* transaction owning the
66
UT_LIST_NODE_T(lock_t)
67
trx_locks; /* list of the locks of the
69
ulint type_mode; /* lock type, mode, LOCK_GAP or
71
LOCK_INSERT_INTENTION,
73
hash_node_t hash; /* hash chain node for a record
75
dict_index_t* index; /* index for a record lock */
77
lock_table_t tab_lock;/* table lock */
78
lock_rec_t rec_lock;/* record lock */
82
/*************************************************************************
83
Gets the type of a lock. */
88
/* out: LOCK_TABLE or LOCK_REC */
89
const lock_t* lock); /* in: lock */
91
/*************************************************************************
92
Gets the previous record lock set on a record. */
97
/* out: previous lock on the same
98
record, NULL if none exists */
99
const lock_t* in_lock,/* in: record lock */
100
ulint heap_no);/* in: heap number of the record */
103
#include "lock0priv.ic"
106
#endif /* lock0priv_h */