InnoDB Plugin  1.0
page0cur.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1994, 2013, Oracle and/or its affiliates. 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.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /********************************************************************/
26 #ifndef page0cur_h
27 #define page0cur_h
28 
29 #include "univ.i"
30 
31 #include "buf0types.h"
32 #include "page0page.h"
33 #include "rem0rec.h"
34 #include "data0data.h"
35 #include "mtr0mtr.h"
36 
37 
38 #define PAGE_CUR_ADAPT
39 
40 /* Page cursor search modes; the values must be in this order! */
41 
42 #define PAGE_CUR_UNSUPP 0
43 #define PAGE_CUR_G 1
44 #define PAGE_CUR_GE 2
45 #define PAGE_CUR_L 3
46 #define PAGE_CUR_LE 4
47 /*#define PAGE_CUR_LE_OR_EXTENDS 5*/ /* This is a search mode used in
48  "column LIKE 'abc%' ORDER BY column DESC";
49  we have to find strings which are <= 'abc' or
50  which extend it */
51 #ifdef UNIV_SEARCH_DEBUG
52 # define PAGE_CUR_DBG 6 /* As PAGE_CUR_LE, but skips search shortcut */
53 #endif /* UNIV_SEARCH_DEBUG */
54 
55 #ifdef UNIV_DEBUG
56 /*********************************************************/
59 UNIV_INLINE
60 page_t*
62 /*==============*/
63  page_cur_t* cur);
64 /*********************************************************/
67 UNIV_INLINE
70 /*===============*/
71  page_cur_t* cur);
72 /*********************************************************/
75 UNIV_INLINE
78 /*==================*/
79  page_cur_t* cur);
80 /*********************************************************/
83 UNIV_INLINE
84 rec_t*
86 /*=============*/
87  page_cur_t* cur);
88 #else /* UNIV_DEBUG */
89 # define page_cur_get_page(cur) page_align((cur)->rec)
90 # define page_cur_get_block(cur) (cur)->block
91 # define page_cur_get_page_zip(cur) buf_block_get_page_zip((cur)->block)
92 # define page_cur_get_rec(cur) (cur)->rec
93 #endif /* UNIV_DEBUG */
94 /*********************************************************/
97 UNIV_INLINE
98 void
100 /*======================*/
101  const buf_block_t* block,
102  page_cur_t* cur);
103 /*********************************************************/
106 UNIV_INLINE
107 void
109 /*====================*/
110  const buf_block_t* block,
111  page_cur_t* cur);
112 /*********************************************************/
115 UNIV_INLINE
116 ibool
118 /*=====================*/
119  const page_cur_t* cur);
120 /*********************************************************/
123 UNIV_INLINE
124 ibool
126 /*===================*/
127  const page_cur_t* cur);
128 /**********************************************************/
130 UNIV_INLINE
131 void
133 /*==============*/
134  const rec_t* rec,
135  const buf_block_t* block,
137  page_cur_t* cur);
138 /**********************************************************/
140 UNIV_INLINE
141 void
143 /*================*/
144  page_cur_t* cur);
145 /**********************************************************/
147 UNIV_INLINE
148 void
150 /*==================*/
151  page_cur_t* cur);
152 /**********************************************************/
154 UNIV_INLINE
155 void
157 /*==================*/
158  page_cur_t* cur);
159 #ifndef UNIV_HOTBACKUP
160 /***********************************************************/
172 UNIV_INLINE
173 rec_t*
175 /*==================*/
176  page_cur_t* cursor,
177  const dtuple_t* tuple,
178  dict_index_t* index,
179  ulint** offsets,
180  mem_heap_t** heap,
181  ulint n_ext,
182  mtr_t* mtr)
183  __attribute__((nonnull(1,2,3,4,5), warn_unused_result));
184 #endif /* !UNIV_HOTBACKUP */
185 /***********************************************************/
197 UNIV_INLINE
198 rec_t*
200 /*================*/
201  page_cur_t* cursor,
202  const rec_t* rec,
203  dict_index_t* index,
204  ulint* offsets,
205  mtr_t* mtr);
206 /***********************************************************/
211 UNIV_INTERN
212 rec_t*
214 /*====================*/
215  rec_t* current_rec,
217  dict_index_t* index,
218  const rec_t* rec,
219  ulint* offsets,
220  mtr_t* mtr)
221  __attribute__((nonnull(1,2,3,4), warn_unused_result));
222 /***********************************************************/
234 UNIV_INTERN
235 rec_t*
237 /*====================*/
238  page_cur_t* cursor,
239  dict_index_t* index,
240  const rec_t* rec,
241  ulint* offsets,
242  mtr_t* mtr)
243  __attribute__((nonnull(1,2,3,4), warn_unused_result));
244 /*************************************************************/
252 UNIV_INTERN
253 void
255 /*===================================*/
256  page_t* new_page,
257  rec_t* rec,
258  dict_index_t* index,
259  mtr_t* mtr);
260 /***********************************************************/
263 UNIV_INTERN
264 void
266 /*================*/
267  page_cur_t* cursor,
268  const dict_index_t* index,
269  const ulint* offsets,
271  mtr_t* mtr);
272 #ifndef UNIV_HOTBACKUP
273 /****************************************************************/
276 UNIV_INLINE
277 ulint
279 /*============*/
280  const buf_block_t* block,
281  const dict_index_t* index,
282  const dtuple_t* tuple,
283  ulint mode,
286  page_cur_t* cursor);
287 /****************************************************************/
289 UNIV_INTERN
290 void
292 /*=======================*/
293  const buf_block_t* block,
294  const dict_index_t* index,
295  const dtuple_t* tuple,
296  ulint mode,
299  ulint* iup_matched_fields,
302  ulint* iup_matched_bytes,
306  ulint* ilow_matched_fields,
309  ulint* ilow_matched_bytes,
313  page_cur_t* cursor);
314 /***********************************************************/
317 UNIV_INTERN
318 void
320 /*==========================*/
321  buf_block_t* block,
322  page_cur_t* cursor);
323 #endif /* !UNIV_HOTBACKUP */
324 /***********************************************************/
327 UNIV_INTERN
328 byte*
330 /*======================*/
331  ibool is_short,
332  byte* ptr,
333  byte* end_ptr,
334  buf_block_t* block,
335  dict_index_t* index,
336  mtr_t* mtr);
337 /**********************************************************/
340 UNIV_INTERN
341 byte*
343 /*=====================================*/
344  byte* ptr,
345  byte* end_ptr,
346  buf_block_t* block,
347  dict_index_t* index,
348  mtr_t* mtr);
349 /***********************************************************/
352 UNIV_INTERN
353 byte*
355 /*======================*/
356  byte* ptr,
357  byte* end_ptr,
358  buf_block_t* block,
359  dict_index_t* index,
360  mtr_t* mtr);
361 /*******************************************************/
365 UNIV_INTERN
366 bool
368 /*============*/
369  const dict_index_t* index,
371  page_cur_t* pcur,
373  page_zip_des_t* page_zip,
374  const ulint* offsets);
378 struct page_cur_t{
379  byte* rec;
381 };
382 
383 #ifndef UNIV_NONINL
384 #include "page0cur.ic"
385 #endif
386 
387 #endif