1
1
/*****************************************************************************
3
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
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
82
82
closed with btr_pcur_close. */
87
87
dict_index_t* index, /*!< in: index */
88
88
const dtuple_t* tuple, /*!< in: tuple on which search done */
89
89
ulint mode, /*!< in: PAGE_CUR_L, ...;
95
95
ulint latch_mode,/*!< in: BTR_SEARCH_LEAF, ... */
96
96
btr_pcur_t* cursor, /*!< in: memory buffer for persistent cursor */
97
const char* file, /*!< in: file name */
98
ulint line, /*!< in: line where called */
99
97
mtr_t* mtr); /*!< in: mtr */
100
#define btr_pcur_open(i,t,md,l,c,m) \
101
btr_pcur_open_func(i,t,md,l,c,__FILE__,__LINE__,m)
102
98
/**************************************************************//**
103
99
Opens an persistent cursor to an index tree without initializing the
107
btr_pcur_open_with_no_init_func(
108
/*============================*/
103
btr_pcur_open_with_no_init(
104
/*=======================*/
109
105
dict_index_t* index, /*!< in: index */
110
106
const dtuple_t* tuple, /*!< in: tuple on which search done */
111
107
ulint mode, /*!< in: PAGE_CUR_L, ...;
123
119
ulint has_search_latch,/*!< in: latch mode the caller
124
120
currently has on btr_search_latch:
125
121
RW_S_LATCH, or 0 */
126
const char* file, /*!< in: file name */
127
ulint line, /*!< in: line where called */
128
122
mtr_t* mtr); /*!< in: mtr */
129
#define btr_pcur_open_with_no_init(ix,t,md,l,cur,has,m) \
130
btr_pcur_open_with_no_init_func(ix,t,md,l,cur,has,__FILE__,__LINE__,m)
132
123
/*****************************************************************//**
133
124
Opens a persistent cursor at either end of an index. */
169
160
BTR_MODIFY_LEAF. */
172
btr_pcur_open_on_user_rec_func(
173
/*===========================*/
163
btr_pcur_open_on_user_rec(
164
/*======================*/
174
165
dict_index_t* index, /*!< in: index */
175
166
const dtuple_t* tuple, /*!< in: tuple on which search done */
176
167
ulint mode, /*!< in: PAGE_CUR_L, ... */
178
169
BTR_MODIFY_LEAF */
179
170
btr_pcur_t* cursor, /*!< in: memory buffer for persistent
181
const char* file, /*!< in: file name */
182
ulint line, /*!< in: line where called */
183
172
mtr_t* mtr); /*!< in: mtr */
184
#define btr_pcur_open_on_user_rec(i,t,md,l,c,m) \
185
btr_pcur_open_on_user_rec_func(i,t,md,l,c,__FILE__,__LINE__,m)
186
173
/**********************************************************************//**
187
174
Positions a cursor at a randomly chosen position within a B-tree. */
190
btr_pcur_open_at_rnd_pos_func(
191
/*==========================*/
177
btr_pcur_open_at_rnd_pos(
178
/*=====================*/
192
179
dict_index_t* index, /*!< in: index */
193
180
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
194
181
btr_pcur_t* cursor, /*!< in/out: B-tree pcur */
195
const char* file, /*!< in: file name */
196
ulint line, /*!< in: line where called */
197
182
mtr_t* mtr); /*!< in: mtr */
198
#define btr_pcur_open_at_rnd_pos(i,l,c,m) \
199
btr_pcur_open_at_rnd_pos_func(i,l,c,__FILE__,__LINE__,m)
200
183
/**************************************************************//**
201
184
Frees the possible old_rec_buf buffer of a persistent cursor and sets the
202
185
latch mode of the persistent cursor to BTR_NO_LATCHES. */
235
218
are identical to the ones of the original user record */
238
btr_pcur_restore_position_func(
239
/*===========================*/
221
btr_pcur_restore_position(
222
/*======================*/
240
223
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
241
224
btr_pcur_t* cursor, /*!< in: detached persistent cursor */
242
const char* file, /*!< in: file name */
243
ulint line, /*!< in: line where called */
244
225
mtr_t* mtr); /*!< in: mtr */
245
#define btr_pcur_restore_position(l,cur,mtr) \
246
btr_pcur_restore_position_func(l,cur,__FILE__,__LINE__,mtr)
247
226
/**************************************************************//**
248
227
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
249
228
releases the page latch and bufferfix reserved by the cursor.
281
260
/*=============*/
282
261
btr_pcur_t* cursor); /*!< in: persistent cursor */
283
262
/**************************************************************//**
284
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
263
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
285
264
that is, the cursor becomes detached. If there have been modifications
286
265
to the page where pcur is positioned, this can be used instead of
287
266
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
288
267
before calling this, if restoration of cursor is wanted later. */
272
btr_pcur_t* pcur); /*!< in: persistent cursor */
273
/**************************************************************//**
274
Differs from btr_pcur_commit in that we can specify the mtr to commit. */
291
277
btr_pcur_commit_specify_mtr(
292
278
/*========================*/
293
279
btr_pcur_t* pcur, /*!< in: persistent cursor */