drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
page0cur.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/********************************************************************/
25
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/*********************************************************/
60UNIV_INLINE
61page_t*
62page_cur_get_page(
63/*==============*/
64 page_cur_t* cur);
65/*********************************************************/
68UNIV_INLINE
70page_cur_get_block(
71/*===============*/
72 page_cur_t* cur);
73/*********************************************************/
76UNIV_INLINE
78page_cur_get_page_zip(
79/*==================*/
80 page_cur_t* cur);
81/*********************************************************/
84UNIV_INLINE
85rec_t*
86page_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/*********************************************************/
98UNIV_INLINE
99void
101/*======================*/
102 const buf_block_t* block,
103 page_cur_t* cur);
104/*********************************************************/
107UNIV_INLINE
108void
110/*====================*/
111 const buf_block_t* block,
112 page_cur_t* cur);
113/*********************************************************/
116UNIV_INLINE
117ibool
119/*=====================*/
120 const page_cur_t* cur);
121/*********************************************************/
124UNIV_INLINE
125ibool
127/*===================*/
128 const page_cur_t* cur);
129/**********************************************************/
131UNIV_INLINE
132void
134/*==============*/
135 const rec_t* rec,
136 const buf_block_t* block,
138 page_cur_t* cur);
139/**********************************************************/
141UNIV_INLINE
142void
144/*================*/
145 page_cur_t* cur);
146/**********************************************************/
148UNIV_INLINE
149void
151/*==================*/
152 page_cur_t* cur);
153/**********************************************************/
155UNIV_INLINE
156void
158/*==================*/
159 page_cur_t* cur);
160#ifndef UNIV_HOTBACKUP
161/***********************************************************/
167UNIV_INLINE
168rec_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/***********************************************************/
183UNIV_INLINE
184rec_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/***********************************************************/
197UNIV_INTERN
198rec_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/***********************************************************/
213UNIV_INTERN
214rec_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/*************************************************************/
227UNIV_INTERN
228void
230/*===================================*/
231 page_t* new_page,
232 rec_t* rec,
233 dict_index_t* index,
234 mtr_t* mtr);
235/***********************************************************/
238UNIV_INTERN
239void
241/*================*/
242 page_cur_t* cursor,
243 dict_index_t* index,
244 const ulint* offsets,
245 mtr_t* mtr);
246#ifndef UNIV_HOTBACKUP
247/****************************************************************/
250UNIV_INLINE
251ulint
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/****************************************************************/
263UNIV_INTERN
264void
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/***********************************************************/
291UNIV_INTERN
292void
294/*==========================*/
295 buf_block_t* block,
296 page_cur_t* cursor);
297#endif /* !UNIV_HOTBACKUP */
298/***********************************************************/
301UNIV_INTERN
302byte*
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/**********************************************************/
314UNIV_INTERN
315byte*
317/*=====================================*/
318 byte* ptr,
319 byte* end_ptr,
320 buf_block_t* block,
321 dict_index_t* index,
322 mtr_t* mtr);
323/***********************************************************/
326UNIV_INTERN
327byte*
329/*======================*/
330 byte* ptr,
331 byte* end_ptr,
332 buf_block_t* block,
333 dict_index_t* index,
334 mtr_t* mtr);
335
337
342
343#ifndef UNIV_NONINL
344#include "page0cur.ic"
345#endif
346
347#endif
struct buf_block_struct buf_block_t
Definition buf0types.h:33
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_INLINE void page_cur_move_to_next(page_cur_t *cur)
UNIV_INLINE void page_cur_set_before_first(const buf_block_t *block, 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
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_INTERN void page_cur_open_on_rnd_user_rec(buf_block_t *block, page_cur_t *cursor)
Definition page0cur.cc:545
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_INLINE void page_cur_position(const rec_t *rec, const buf_block_t *block, page_cur_t *cur)
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 void page_cur_set_after_last(const buf_block_t *block, page_cur_t *cur)
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 ibool page_cur_is_after_last(const page_cur_t *cur)
UNIV_INLINE void page_cur_move_to_prev(page_cur_t *cur)
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_INLINE ibool page_cur_is_before_first(const page_cur_t *cur)
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_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_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_INLINE void page_cur_invalidate(page_cur_t *cur)
struct page_cur_struct page_cur_t
Definition page0types.h:39
struct page_zip_des_struct page_zip_des_t
Definition page0types.h:44
#define page_t
Definition page0types.h:35
buf_block_t * block
Definition page0cur.h:340