38
39
#include "trx0types.h"
39
40
#include "ut0lst.h"
42
43
typedef struct lock_table_struct lock_table_t;
43
45
struct lock_table_struct {
44
dict_table_t* table; /* database table in dictionary
46
dict_table_t* table; /*!< database table in dictionary
46
48
UT_LIST_NODE_T(lock_t)
47
locks; /* list of locks on the same
49
locks; /*!< list of locks on the same
51
/* Record lock for a page */
53
/** Record lock for a page */
52
54
typedef struct lock_rec_struct lock_rec_t;
55
/** Record lock for a page */
53
56
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
ulint space; /*!< space id */
58
ulint page_no; /*!< page number */
59
ulint n_bits; /*!< number of bits in the lock
57
60
bitmap; NOTE: the lock bitmap is
58
61
placed immediately after the
63
66
struct lock_struct {
64
trx_t* trx; /* transaction owning the
67
trx_t* trx; /*!< transaction owning the
66
69
UT_LIST_NODE_T(lock_t)
67
trx_locks; /* list of the locks of the
70
trx_locks; /*!< list of the locks of the
69
ulint type_mode; /* lock type, mode, LOCK_GAP or
72
ulint type_mode; /*!< lock type, mode, LOCK_GAP or
71
74
LOCK_INSERT_INTENTION,
73
hash_node_t hash; /* hash chain node for a record
76
hash_node_t hash; /*!< hash chain node for a record
75
dict_index_t* index; /* index for a record lock */
78
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 */
80
lock_table_t tab_lock;/*!< table lock */
81
lock_rec_t rec_lock;/*!< record lock */
82
} un_member; /*!< lock details */
82
/*************************************************************************
83
Gets the type of a lock. */
85
/*********************************************************************//**
86
Gets the type of a lock.
87
@return LOCK_TABLE or LOCK_REC */
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. */
92
const lock_t* lock); /*!< in: lock */
94
/*********************************************************************//**
95
Gets the previous record lock set on a record.
96
@return previous lock on the same record, NULL if none exists */
96
100
/*==============*/
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 */
101
const lock_t* in_lock,/*!< in: record lock */
102
ulint heap_no);/*!< in: heap number of the record */
102
104
#ifndef UNIV_NONINL
103
105
#include "lock0priv.ic"