~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/lock0priv.h

  • Committer: lbieber
  • Date: 2010-10-01 13:06:31 UTC
  • mfrom: (1802.2.2 drizzle-bug-651948)
  • mto: This revision was merged to the branch mainline in revision 1805.
  • Revision ID: lbieber@orisndriz08-20101001130631-xubscnhmj7r5dn6g
Merge Andrew - Fix bug 651948 - Index lengths not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 2007, 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/lock0priv.h
21
 
Lock module internal structures and methods.
22
 
 
23
 
Created July 12, 2007 Vasil Dimov
24
 
*******************************************************/
25
 
 
26
 
#ifndef lock0priv_h
27
 
#define lock0priv_h
28
 
 
29
 
#ifndef LOCK_MODULE_IMPLEMENTATION
30
 
/* If you need to access members of the structures defined in this
31
 
file, please write appropriate functions that retrieve them and put
32
 
those functions in lock/ */
33
 
#error Do not include lock0priv.h outside of the lock/ module
34
 
#endif
35
 
 
36
 
#include "univ.i"
37
 
#include "dict0types.h"
38
 
#include "hash0hash.h"
39
 
#include "trx0types.h"
40
 
#include "ut0lst.h"
41
 
 
42
 
/** A table lock */
43
 
typedef struct lock_table_struct        lock_table_t;
44
 
/** A table lock */
45
 
struct lock_table_struct {
46
 
        dict_table_t*   table;          /*!< database table in dictionary
47
 
                                        cache */
48
 
        UT_LIST_NODE_T(lock_t)
49
 
                        locks;          /*!< list of locks on the same
50
 
                                        table */
51
 
};
52
 
 
53
 
/** Record lock for a page */
54
 
typedef struct lock_rec_struct          lock_rec_t;
55
 
/** Record lock for a page */
56
 
struct lock_rec_struct {
57
 
        ulint   space;                  /*!< space id */
58
 
        ulint   page_no;                /*!< page number */
59
 
        ulint   n_bits;                 /*!< number of bits in the lock
60
 
                                        bitmap; NOTE: the lock bitmap is
61
 
                                        placed immediately after the
62
 
                                        lock struct */
63
 
};
64
 
 
65
 
/** Lock struct */
66
 
struct lock_struct {
67
 
        trx_t*          trx;            /*!< transaction owning the
68
 
                                        lock */
69
 
        UT_LIST_NODE_T(lock_t)
70
 
                        trx_locks;      /*!< list of the locks of the
71
 
                                        transaction */
72
 
        ulint           type_mode;      /*!< lock type, mode, LOCK_GAP or
73
 
                                        LOCK_REC_NOT_GAP,
74
 
                                        LOCK_INSERT_INTENTION,
75
 
                                        wait flag, ORed */
76
 
        hash_node_t     hash;           /*!< hash chain node for a record
77
 
                                        lock */
78
 
        dict_index_t*   index;          /*!< index for a record lock */
79
 
        union {
80
 
                lock_table_t    tab_lock;/*!< table lock */
81
 
                lock_rec_t      rec_lock;/*!< record lock */
82
 
        } un_member;                    /*!< lock details */
83
 
};
84
 
 
85
 
/*********************************************************************//**
86
 
Gets the type of a lock.
87
 
@return LOCK_TABLE or LOCK_REC */
88
 
UNIV_INLINE
89
 
ulint
90
 
lock_get_type_low(
91
 
/*==============*/
92
 
        const lock_t*   lock);  /*!< in: lock */
93
 
 
94
 
/*********************************************************************//**
95
 
Gets the previous record lock set on a record.
96
 
@return previous lock on the same record, NULL if none exists */
97
 
UNIV_INTERN
98
 
const lock_t*
99
 
lock_rec_get_prev(
100
 
/*==============*/
101
 
        const lock_t*   in_lock,/*!< in: record lock */
102
 
        ulint           heap_no);/*!< in: heap number of the record */
103
 
 
104
 
#ifndef UNIV_NONINL
105
 
#include "lock0priv.ic"
106
 
#endif
107
 
 
108
 
#endif /* lock0priv_h */