~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/btr0types.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
30
30
 
31
31
#include "rem0types.h"
32
32
#include "page0types.h"
 
33
#include "sync0rw.h"
33
34
 
34
35
/** Persistent cursor */
35
36
typedef struct btr_pcur_struct          btr_pcur_t;
38
39
/** B-tree search information for the adaptive hash index */
39
40
typedef struct btr_search_struct        btr_search_t;
40
41
 
 
42
/** @brief The latch protecting the adaptive search system
 
43
 
 
44
This latch protects the
 
45
(1) hash index;
 
46
(2) columns of a record to which we have a pointer in the hash index;
 
47
 
 
48
but does NOT protect:
 
49
 
 
50
(3) next record offset field in a record;
 
51
(4) next or previous records on the same page.
 
52
 
 
53
Bear in mind (3) and (4) when using the hash index.
 
54
*/
 
55
extern rw_lock_t*       btr_search_latch_temp;
 
56
 
 
57
/** The latch protecting the adaptive search system */
 
58
#define btr_search_latch        (*btr_search_latch_temp)
 
59
 
 
60
/** Flag: has the search system been enabled?
 
61
Protected by btr_search_latch. */
 
62
extern char     btr_search_enabled;
 
63
 
 
64
#ifdef UNIV_BLOB_DEBUG
 
65
# include "buf0types.h"
 
66
/** An index->blobs entry for keeping track of off-page column references */
 
67
typedef struct btr_blob_dbg_struct btr_blob_dbg_t;
 
68
 
 
69
/** Insert to index->blobs a reference to an off-page column.
 
70
@param index    the index tree
 
71
@param b        the reference
 
72
@param ctx      context (for logging) */
 
73
UNIV_INTERN
 
74
void
 
75
btr_blob_dbg_rbt_insert(
 
76
/*====================*/
 
77
        dict_index_t*           index,  /*!< in/out: index tree */
 
78
        const btr_blob_dbg_t*   b,      /*!< in: the reference */
 
79
        const char*             ctx)    /*!< in: context (for logging) */
 
80
        __attribute__((nonnull));
 
81
 
 
82
/** Remove from index->blobs a reference to an off-page column.
 
83
@param index    the index tree
 
84
@param b        the reference
 
85
@param ctx      context (for logging) */
 
86
UNIV_INTERN
 
87
void
 
88
btr_blob_dbg_rbt_delete(
 
89
/*====================*/
 
90
        dict_index_t*           index,  /*!< in/out: index tree */
 
91
        const btr_blob_dbg_t*   b,      /*!< in: the reference */
 
92
        const char*             ctx)    /*!< in: context (for logging) */
 
93
        __attribute__((nonnull));
 
94
 
 
95
/**************************************************************//**
 
96
Add to index->blobs any references to off-page columns from a record.
 
97
@return number of references added */
 
98
UNIV_INTERN
 
99
ulint
 
100
btr_blob_dbg_add_rec(
 
101
/*=================*/
 
102
        const rec_t*    rec,    /*!< in: record */
 
103
        dict_index_t*   index,  /*!< in/out: index */
 
104
        const ulint*    offsets,/*!< in: offsets */
 
105
        const char*     ctx)    /*!< in: context (for logging) */
 
106
        __attribute__((nonnull));
 
107
/**************************************************************//**
 
108
Remove from index->blobs any references to off-page columns from a record.
 
109
@return number of references removed */
 
110
UNIV_INTERN
 
111
ulint
 
112
btr_blob_dbg_remove_rec(
 
113
/*====================*/
 
114
        const rec_t*    rec,    /*!< in: record */
 
115
        dict_index_t*   index,  /*!< in/out: index */
 
116
        const ulint*    offsets,/*!< in: offsets */
 
117
        const char*     ctx)    /*!< in: context (for logging) */
 
118
        __attribute__((nonnull));
 
119
/**************************************************************//**
 
120
Count and add to index->blobs any references to off-page columns
 
121
from records on a page.
 
122
@return number of references added */
 
123
UNIV_INTERN
 
124
ulint
 
125
btr_blob_dbg_add(
 
126
/*=============*/
 
127
        const page_t*   page,   /*!< in: rewritten page */
 
128
        dict_index_t*   index,  /*!< in/out: index */
 
129
        const char*     ctx)    /*!< in: context (for logging) */
 
130
        __attribute__((nonnull));
 
131
/**************************************************************//**
 
132
Count and remove from index->blobs any references to off-page columns
 
133
from records on a page.
 
134
Used when reorganizing a page, before copying the records.
 
135
@return number of references removed */
 
136
UNIV_INTERN
 
137
ulint
 
138
btr_blob_dbg_remove(
 
139
/*================*/
 
140
        const page_t*   page,   /*!< in: b-tree page */
 
141
        dict_index_t*   index,  /*!< in/out: index */
 
142
        const char*     ctx)    /*!< in: context (for logging) */
 
143
        __attribute__((nonnull));
 
144
/**************************************************************//**
 
145
Restore in index->blobs any references to off-page columns
 
146
Used when page reorganize fails due to compressed page overflow. */
 
147
UNIV_INTERN
 
148
void
 
149
btr_blob_dbg_restore(
 
150
/*=================*/
 
151
        const page_t*   npage,  /*!< in: page that failed to compress */
 
152
        const page_t*   page,   /*!< in: copy of original page */
 
153
        dict_index_t*   index,  /*!< in/out: index */
 
154
        const char*     ctx)    /*!< in: context (for logging) */
 
155
        __attribute__((nonnull));
 
156
 
 
157
/** Operation that processes the BLOB references of an index record
 
158
@param[in]      rec     record on index page
 
159
@param[in/out]  index   the index tree of the record
 
160
@param[in]      offsets rec_get_offsets(rec,index)
 
161
@param[in]      ctx     context (for logging)
 
162
@return                 number of BLOB references processed */
 
163
typedef ulint (*btr_blob_dbg_op_f)
 
164
(const rec_t* rec,dict_index_t* index,const ulint* offsets,const char* ctx);
 
165
 
 
166
/**************************************************************//**
 
167
Count and process all references to off-page columns on a page.
 
168
@return number of references processed */
 
169
UNIV_INTERN
 
170
ulint
 
171
btr_blob_dbg_op(
 
172
/*============*/
 
173
        const page_t*           page,   /*!< in: B-tree leaf page */
 
174
        const rec_t*            rec,    /*!< in: record to start from
 
175
                                        (NULL to process the whole page) */
 
176
        dict_index_t*           index,  /*!< in/out: index */
 
177
        const char*             ctx,    /*!< in: context (for logging) */
 
178
        const btr_blob_dbg_op_f op)     /*!< in: operation on records */
 
179
        __attribute__((nonnull(1,3,4,5)));
 
180
#else /* UNIV_BLOB_DEBUG */
 
181
# define btr_blob_dbg_add_rec(rec, index, offsets, ctx)         ((void) 0)
 
182
# define btr_blob_dbg_add(page, index, ctx)                     ((void) 0)
 
183
# define btr_blob_dbg_remove_rec(rec, index, offsets, ctx)      ((void) 0)
 
184
# define btr_blob_dbg_remove(page, index, ctx)                  ((void) 0)
 
185
# define btr_blob_dbg_restore(npage, page, index, ctx)          ((void) 0)
 
186
# define btr_blob_dbg_op(page, rec, index, ctx, op)             ((void) 0)
 
187
#endif /* UNIV_BLOB_DEBUG */
 
188
 
41
189
/** The size of a reference to data stored on a different page.
42
190
The reference is stored at the end of the prefix of the field
43
191
in the index record. */