Drizzled Public API Documentation

page0cur.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1994, 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 /********************************************************************/
26 #pragma once
27 #ifndef page0cur_h
28 #define page0cur_h
29 
30 #include "univ.i"
31 
32 #include "buf0types.h"
33 #include "page0page.h"
34 #include "rem0rec.h"
35 #include "data0data.h"
36 #include "mtr0mtr.h"
37 
38 
39 #define PAGE_CUR_ADAPT
40 
41 /* Page cursor search modes; the values must be in this order! */
42 
43 #define PAGE_CUR_UNSUPP 0
44 #define PAGE_CUR_G 1
45 #define PAGE_CUR_GE 2
46 #define PAGE_CUR_L 3
47 #define PAGE_CUR_LE 4
48 /*#define PAGE_CUR_LE_OR_EXTENDS 5*/ /* This is a search mode used in
49  "column LIKE 'abc%' ORDER BY column DESC";
50  we have to find strings which are <= 'abc' or
51  which extend it */
52 #ifdef UNIV_SEARCH_DEBUG
53 # define PAGE_CUR_DBG 6 /* As PAGE_CUR_LE, but skips search shortcut */
54 #endif /* UNIV_SEARCH_DEBUG */
55 
56 #ifdef UNIV_DEBUG
57 /*********************************************************/
60 UNIV_INLINE
61 page_t*
62 page_cur_get_page(
63 /*==============*/
64  page_cur_t* cur);
65 /*********************************************************/
68 UNIV_INLINE
70 page_cur_get_block(
71 /*===============*/
72  page_cur_t* cur);
73 /*********************************************************/
76 UNIV_INLINE
78 page_cur_get_page_zip(
79 /*==================*/
80  page_cur_t* cur);
81 /*********************************************************/
84 UNIV_INLINE
85 rec_t*
86 page_cur_get_rec(
87 /*=============*/
88  page_cur_t* cur);
89 #else /* UNIV_DEBUG */
90 # define page_cur_get_page(cur) page_align((cur)->rec)
91 # define page_cur_get_block(cur) (cur)->block
92 # define page_cur_get_page_zip(cur) buf_block_get_page_zip((cur)->block)
93 # define page_cur_get_rec(cur) (cur)->rec
94 #endif /* UNIV_DEBUG */
95 /*********************************************************/
98 UNIV_INLINE
99 void
101 /*======================*/
102  const buf_block_t* block,
103  page_cur_t* cur);
104 /*********************************************************/
107 UNIV_INLINE
108 void
110 /*====================*/
111  const buf_block_t* block,
112  page_cur_t* cur);
113 /*********************************************************/
116 UNIV_INLINE
117 ibool
119 /*=====================*/
120  const page_cur_t* cur);
121 /*********************************************************/
124 UNIV_INLINE
125 ibool
127 /*===================*/
128  const page_cur_t* cur);
129 /**********************************************************/
131 UNIV_INLINE
132 void
134 /*==============*/
135  const rec_t* rec,
136  const buf_block_t* block,
138  page_cur_t* cur);
139 /**********************************************************/
141 UNIV_INLINE
142 void
144 /*================*/
145  page_cur_t* cur);
146 /**********************************************************/
148 UNIV_INLINE
149 void
151 /*==================*/
152  page_cur_t* cur);
153 /**********************************************************/
155 UNIV_INLINE
156 void
158 /*==================*/
159  page_cur_t* cur);
160 #ifndef UNIV_HOTBACKUP
161 /***********************************************************/
167 UNIV_INLINE
168 rec_t*
170 /*==================*/
171  page_cur_t* cursor,
172  const dtuple_t* tuple,
173  dict_index_t* index,
174  ulint n_ext,
175  mtr_t* mtr);
176 #endif /* !UNIV_HOTBACKUP */
177 /***********************************************************/
183 UNIV_INLINE
184 rec_t*
186 /*================*/
187  page_cur_t* cursor,
188  const rec_t* rec,
189  dict_index_t* index,
190  ulint* offsets,
191  mtr_t* mtr);
192 /***********************************************************/
197 UNIV_INTERN
198 rec_t*
200 /*====================*/
201  rec_t* current_rec,
203  dict_index_t* index,
204  const rec_t* rec,
205  ulint* offsets,
206  mtr_t* mtr);
207 /***********************************************************/
213 UNIV_INTERN
214 rec_t*
216 /*====================*/
217  rec_t** current_rec,
219  buf_block_t* block,
220  dict_index_t* index,
221  const rec_t* rec,
222  ulint* offsets,
223  mtr_t* mtr);
224 /*************************************************************/
227 UNIV_INTERN
228 void
230 /*===================================*/
231  page_t* new_page,
232  rec_t* rec,
233  dict_index_t* index,
234  mtr_t* mtr);
235 /***********************************************************/
238 UNIV_INTERN
239 void
241 /*================*/
242  page_cur_t* cursor,
243  dict_index_t* index,
244  const ulint* offsets,
245  mtr_t* mtr);
246 #ifndef UNIV_HOTBACKUP
247 /****************************************************************/
250 UNIV_INLINE
251 ulint
253 /*============*/
254  const buf_block_t* block,
255  const dict_index_t* index,
256  const dtuple_t* tuple,
257  ulint mode,
260  page_cur_t* cursor);
261 /****************************************************************/
263 UNIV_INTERN
264 void
266 /*=======================*/
267  const buf_block_t* block,
268  const dict_index_t* index,
269  const dtuple_t* tuple,
270  ulint mode,
273  ulint* iup_matched_fields,
276  ulint* iup_matched_bytes,
280  ulint* ilow_matched_fields,
283  ulint* ilow_matched_bytes,
287  page_cur_t* cursor);
288 /***********************************************************/
291 UNIV_INTERN
292 void
294 /*==========================*/
295  buf_block_t* block,
296  page_cur_t* cursor);
297 #endif /* !UNIV_HOTBACKUP */
298 /***********************************************************/
301 UNIV_INTERN
302 byte*
304 /*======================*/
305  ibool is_short,
306  byte* ptr,
307  byte* end_ptr,
308  buf_block_t* block,
309  dict_index_t* index,
310  mtr_t* mtr);
311 /**********************************************************/
314 UNIV_INTERN
315 byte*
317 /*=====================================*/
318  byte* ptr,
319  byte* end_ptr,
320  buf_block_t* block,
321  dict_index_t* index,
322  mtr_t* mtr);
323 /***********************************************************/
326 UNIV_INTERN
327 byte*
329 /*======================*/
330  byte* ptr,
331  byte* end_ptr,
332  buf_block_t* block,
333  dict_index_t* index,
334  mtr_t* mtr);
339  byte* rec;
341 };
342 
343 #ifndef UNIV_NONINL
344 #include "page0cur.ic"
345 #endif
346 
347 #endif
UNIV_INLINE void page_cur_invalidate(page_cur_t *cur)
UNIV_INLINE rec_t * page_cur_tuple_insert(page_cur_t *cursor, const dtuple_t *tuple, dict_index_t *index, ulint n_ext, mtr_t *mtr)
UNIV_INTERN void page_cur_search_with_match(const buf_block_t *block, const dict_index_t *index, const dtuple_t *tuple, ulint mode, ulint *iup_matched_fields, ulint *iup_matched_bytes, ulint *ilow_matched_fields, ulint *ilow_matched_bytes, page_cur_t *cursor)
Definition: page0cur.cc:246
UNIV_INLINE rec_t * page_cur_rec_insert(page_cur_t *cursor, const rec_t *rec, dict_index_t *index, ulint *offsets, mtr_t *mtr)
UNIV_INLINE ulint page_cur_search(const buf_block_t *block, const dict_index_t *index, const dtuple_t *tuple, ulint mode, page_cur_t *cursor)
UNIV_INTERN byte * page_parse_copy_rec_list_to_created_page(byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
Definition: page0cur.cc:1542
UNIV_INTERN void page_cur_delete_rec(page_cur_t *cursor, dict_index_t *index, const ulint *offsets, mtr_t *mtr)
Definition: page0cur.cc:1858
UNIV_INTERN byte * page_cur_parse_delete_rec(byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
Definition: page0cur.cc:1809
UNIV_INLINE ibool page_cur_is_before_first(const page_cur_t *cur)
UNIV_INTERN void page_cur_open_on_rnd_user_rec(buf_block_t *block, page_cur_t *cursor)
Definition: page0cur.cc:545
UNIV_INLINE void page_cur_set_before_first(const buf_block_t *block, page_cur_t *cur)
UNIV_INTERN byte * page_cur_parse_insert_rec(ibool is_short, byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
Definition: page0cur.cc:757
UNIV_INTERN rec_t * page_cur_insert_rec_low(rec_t *current_rec, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
Definition: page0cur.cc:950
UNIV_INLINE ibool page_cur_is_after_last(const page_cur_t *cur)
UNIV_INLINE void page_cur_move_to_next(page_cur_t *cur)
UNIV_INTERN void page_copy_rec_list_end_to_created_page(page_t *new_page, rec_t *rec, dict_index_t *index, mtr_t *mtr)
Definition: page0cur.cc:1599
byte page_t
Definition: page0types.h:37
UNIV_INLINE void page_cur_set_after_last(const buf_block_t *block, page_cur_t *cur)
UNIV_INTERN rec_t * page_cur_insert_rec_zip(rec_t **current_rec, buf_block_t *block, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
Definition: page0cur.cc:1217
UNIV_INLINE void page_cur_move_to_prev(page_cur_t *cur)
UNIV_INLINE void page_cur_position(const rec_t *rec, const buf_block_t *block, page_cur_t *cur)
buf_block_t * block
Definition: page0cur.h:340