98
115
page_cur_position(
99
116
/*==============*/
100
rec_t* rec, /* in: record on a page */
101
page_cur_t* cur); /* in: page cursor */
117
const rec_t* rec, /* in: record on a page */
118
const buf_block_t* block, /* in: buffer block containing
120
page_cur_t* cur); /* out: page cursor */
102
121
/**************************************************************
103
122
Invalidates a page cursor by setting the record pointer NULL. */
106
125
page_cur_invalidate(
107
126
/*================*/
108
page_cur_t* cur); /* in: page cursor */
127
page_cur_t* cur); /* out: page cursor */
109
128
/**************************************************************
110
129
Moves the cursor to the next record on page. */
113
132
page_cur_move_to_next(
114
133
/*==================*/
115
page_cur_t* cur); /* in: cursor; must not be after last */
134
page_cur_t* cur); /* in/out: cursor; must not be after last */
116
135
/**************************************************************
117
136
Moves the cursor to the previous record on page. */
120
139
page_cur_move_to_prev(
121
140
/*==================*/
122
page_cur_t* cur); /* in: cursor; must not before first */
141
page_cur_t* cur); /* in/out: cursor; not before first */
123
142
/***************************************************************
124
143
Inserts a record next to page cursor. Returns pointer to inserted record if
125
144
succeed, i.e., enough space available, NULL otherwise. The cursor stays at
126
the same position. */
145
the same logical position, but the physical position may change if it is
146
pointing to a compressed page that was reorganized. */
129
149
page_cur_tuple_insert(
130
150
/*==================*/
131
151
/* out: pointer to record if succeed, NULL
133
page_cur_t* cursor, /* in: a page cursor */
134
dtuple_t* tuple, /* in: pointer to a data tuple */
153
page_cur_t* cursor, /* in/out: a page cursor */
154
const dtuple_t* tuple, /* in: pointer to a data tuple */
135
155
dict_index_t* index, /* in: record descriptor */
136
mtr_t* mtr); /* in: mini-transaction handle */
156
ulint n_ext, /* in: number of externally stored columns */
157
mtr_t* mtr); /* in: mini-transaction handle, or NULL */
137
158
/***************************************************************
138
159
Inserts a record next to page cursor. Returns pointer to inserted record if
139
160
succeed, i.e., enough space available, NULL otherwise. The cursor stays at
140
the same position. */
161
the same logical position, but the physical position may change if it is
162
pointing to a compressed page that was reorganized. */
143
165
page_cur_rec_insert(
144
166
/*================*/
145
167
/* out: pointer to record if succeed, NULL
147
page_cur_t* cursor, /* in: a page cursor */
148
rec_t* rec, /* in: record to insert */
169
page_cur_t* cursor, /* in/out: a page cursor */
170
const rec_t* rec, /* in: record to insert */
149
171
dict_index_t* index, /* in: record descriptor */
150
ulint* offsets,/* in: rec_get_offsets(rec, index) */
151
mtr_t* mtr); /* in: mini-transaction handle */
172
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
173
mtr_t* mtr); /* in: mini-transaction handle, or NULL */
152
174
/***************************************************************
153
Inserts a record next to page cursor. Returns pointer to inserted record if
154
succeed, i.e., enough space available, NULL otherwise. The record to be
155
inserted can be in a data tuple or as a physical record. The other parameter
156
must then be NULL. The cursor stays at the same position. */
175
Inserts a record next to page cursor on an uncompressed page.
176
Returns pointer to inserted record if succeed, i.e., enough
177
space available, NULL otherwise. The cursor stays at the same position. */
159
180
page_cur_insert_rec_low(
160
181
/*====================*/
161
182
/* out: pointer to record if succeed, NULL
163
page_cur_t* cursor, /* in: a page cursor */
164
dtuple_t* tuple, /* in: pointer to a data tuple or NULL */
165
dict_index_t* index, /* in: record descriptor */
166
rec_t* rec, /* in: pointer to a physical record or NULL */
167
ulint* offsets,/* in: rec_get_offsets(rec, index) or NULL */
168
mtr_t* mtr); /* in: mini-transaction handle */
184
rec_t* current_rec,/* in: pointer to current record after
185
which the new record is inserted */
186
dict_index_t* index, /* in: record descriptor */
187
const rec_t* rec, /* in: pointer to a physical record */
188
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
189
mtr_t* mtr); /* in: mini-transaction handle, or NULL */
190
/***************************************************************
191
Inserts a record next to page cursor on a compressed and uncompressed
192
page. Returns pointer to inserted record if succeed, i.e.,
193
enough space available, NULL otherwise.
194
The cursor stays at the same position. */
197
page_cur_insert_rec_zip(
198
/*====================*/
199
/* out: pointer to record if succeed, NULL
201
rec_t** current_rec,/* in/out: pointer to current record after
202
which the new record is inserted */
203
buf_block_t* block, /* in: buffer block of *current_rec */
204
dict_index_t* index, /* in: record descriptor */
205
const rec_t* rec, /* in: pointer to a physical record */
206
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
207
mtr_t* mtr); /* in: mini-transaction handle, or NULL */
169
208
/*****************************************************************
170
209
Copies records from page to a newly created page, from a given record onward,
171
210
including that record. Infimum and supremum records are not copied. */
174
213
page_copy_rec_list_end_to_created_page(
175
214
/*===================================*/
176
page_t* new_page, /* in: index page to copy to */
177
page_t* page, /* in: index page */
215
page_t* new_page, /* in/out: index page to copy to */
178
216
rec_t* rec, /* in: first record to copy */
179
217
dict_index_t* index, /* in: record descriptor */
180
218
mtr_t* mtr); /* in: mtr */
181
219
/***************************************************************
182
220
Deletes a record at the page cursor. The cursor is moved to the
183
221
next record after the deleted one. */
186
224
page_cur_delete_rec(
187
225
/*================*/
188
page_cur_t* cursor, /* in: a page cursor */
226
page_cur_t* cursor, /* in/out: a page cursor */
189
227
dict_index_t* index, /* in: record descriptor */
190
228
const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */
191
229
mtr_t* mtr); /* in: mini-transaction handle */
198
/* out: number of matched fields on the left */
199
page_t* page, /* in: index page */
200
dict_index_t* index, /* in: record descriptor */
201
dtuple_t* tuple, /* in: data tuple */
202
ulint mode, /* in: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G,
204
page_cur_t* cursor);/* out: page cursor */
236
/* out: number of matched
237
fields on the left */
238
const buf_block_t* block, /* in: buffer block */
239
const dict_index_t* index, /* in: record descriptor */
240
const dtuple_t* tuple, /* in: data tuple */
241
ulint mode, /* in: PAGE_CUR_L,
242
PAGE_CUR_LE, PAGE_CUR_G, or
244
page_cur_t* cursor);/* out: page cursor */
205
245
/********************************************************************
206
246
Searches the right position for a page cursor. */
209
249
page_cur_search_with_match(
210
250
/*=======================*/
211
page_t* page, /* in: index page */
212
dict_index_t* index, /* in: record descriptor */
213
dtuple_t* tuple, /* in: data tuple */
214
ulint mode, /* in: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G,
216
ulint* iup_matched_fields,
217
/* in/out: already matched fields in upper
219
ulint* iup_matched_bytes,
220
/* in/out: already matched bytes in a field
221
not yet completely matched */
222
ulint* ilow_matched_fields,
223
/* in/out: already matched fields in lower
225
ulint* ilow_matched_bytes,
226
/* in/out: already matched bytes in a field
227
not yet completely matched */
228
page_cur_t* cursor); /* out: page cursor */
251
const buf_block_t* block, /* in: buffer block */
252
const dict_index_t* index, /* in: record descriptor */
253
const dtuple_t* tuple, /* in: data tuple */
254
ulint mode, /* in: PAGE_CUR_L,
255
PAGE_CUR_LE, PAGE_CUR_G, or
257
ulint* iup_matched_fields,
258
/* in/out: already matched
259
fields in upper limit record */
260
ulint* iup_matched_bytes,
261
/* in/out: already matched
262
bytes in a field not yet
263
completely matched */
264
ulint* ilow_matched_fields,
265
/* in/out: already matched
266
fields in lower limit record */
267
ulint* ilow_matched_bytes,
268
/* in/out: already matched
269
bytes in a field not yet
270
completely matched */
271
page_cur_t* cursor);/* out: page cursor */
229
272
/***************************************************************
230
273
Positions a page cursor on a randomly chosen user record on a page. If there
231
274
are no user records, sets the cursor on the infimum record. */
234
277
page_cur_open_on_rnd_user_rec(
235
278
/*==========================*/
236
page_t* page, /* in: page */
237
page_cur_t* cursor);/* in/out: page cursor */
279
buf_block_t* block, /* in: page */
280
page_cur_t* cursor);/* out: page cursor */
238
281
/***************************************************************
239
282
Parses a log record of a record insert on a page. */
242
285
page_cur_parse_insert_rec(
243
286
/*======================*/
245
288
ibool is_short,/* in: TRUE if short inserts */
246
289
byte* ptr, /* in: buffer */
247
290
byte* end_ptr,/* in: buffer end */
291
buf_block_t* block, /* in: page or NULL */
248
292
dict_index_t* index, /* in: record descriptor */
249
page_t* page, /* in: page or NULL */
250
293
mtr_t* mtr); /* in: mtr or NULL */
251
294
/**************************************************************
252
295
Parses a log record of copying a record list end to a new created page. */
255
298
page_parse_copy_rec_list_to_created_page(
256
299
/*=====================================*/
257
300
/* out: end of log record or NULL */
258
301
byte* ptr, /* in: buffer */
259
302
byte* end_ptr,/* in: buffer end */
303
buf_block_t* block, /* in: page or NULL */
260
304
dict_index_t* index, /* in: record descriptor */
261
page_t* page, /* in: page or NULL */
262
305
mtr_t* mtr); /* in: mtr or NULL */
263
306
/***************************************************************
264
307
Parses log record of a record delete on a page. */
267
310
page_cur_parse_delete_rec(
268
311
/*======================*/
269
312
/* out: pointer to record end or NULL */
270
313
byte* ptr, /* in: buffer */
271
314
byte* end_ptr,/* in: buffer end */
315
buf_block_t* block, /* in: page or NULL */
272
316
dict_index_t* index, /* in: record descriptor */
273
page_t* page, /* in: page or NULL */
274
317
mtr_t* mtr); /* in: mtr or NULL */
276
319
/* Index page cursor */
278
321
struct page_cur_struct{
279
byte* rec; /* pointer to a record on page */
322
byte* rec; /* pointer to a record on page */
323
buf_block_t* block; /* pointer to the block containing rec */
282
326
#ifndef UNIV_NONINL