32
32
/******************************************************************
33
33
Allocates memory for a persistent cursor object and initializes the cursor. */
36
36
btr_pcur_create_for_mysql(void);
37
37
/*============================*/
38
38
/* out, own: persistent cursor */
39
39
/******************************************************************
40
40
Frees the memory for a persistent cursor object. */
43
43
btr_pcur_free_for_mysql(
44
44
/*====================*/
45
45
btr_pcur_t* cursor); /* in, own: persistent cursor */
46
46
/******************************************************************
47
47
Copies the stored position of a pcur to another pcur. */
50
50
btr_pcur_copy_stored_position(
51
51
/*==========================*/
70
70
dict_index_t* index, /* in: index */
71
dtuple_t* tuple, /* in: tuple on which search done */
71
const dtuple_t* tuple, /* in: tuple on which search done */
72
72
ulint mode, /* in: PAGE_CUR_L, ...;
73
73
NOTE that if the search is made using a unique
74
74
prefix of a record, mode should be
86
86
btr_pcur_open_with_no_init(
87
87
/*=======================*/
88
88
dict_index_t* index, /* in: index */
89
dtuple_t* tuple, /* in: tuple on which search done */
89
const dtuple_t* tuple, /* in: tuple on which search done */
90
90
ulint mode, /* in: PAGE_CUR_L, ...;
91
91
NOTE that if the search is made using a unique
92
92
prefix of a record, mode should be
143
143
in the first case sets the cursor after last in tree, and in the latter case
144
144
before first in tree. The latching mode must be BTR_SEARCH_LEAF or
145
145
BTR_MODIFY_LEAF. */
148
148
btr_pcur_open_on_user_rec(
149
149
/*======================*/
150
150
dict_index_t* index, /* in: index */
151
dtuple_t* tuple, /* in: tuple on which search done */
151
const dtuple_t* tuple, /* in: tuple on which search done */
152
152
ulint mode, /* in: PAGE_CUR_L, ... */
153
153
ulint latch_mode, /* in: BTR_SEARCH_LEAF or
154
154
BTR_MODIFY_LEAF */
198
198
GREATER than the user record which was the predecessor of the supremum.
199
199
(4) cursor was positioned before the first or after the last in an empty tree:
200
200
restores to before first or after the last in the tree. */
203
203
btr_pcur_restore_position(
204
204
/*======================*/
216
216
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
217
217
made by the current mini-transaction to the data protected by the
218
218
cursor latch, as then the latch must not be released until mtr_commit. */
221
221
btr_pcur_release_leaf(
222
222
/*==================*/
229
229
btr_pcur_get_rel_pos(
230
230
/*=================*/
231
/* out: BTR_PCUR_ON, ... */
232
btr_pcur_t* cursor);/* in: persistent cursor */
231
/* out: BTR_PCUR_ON, ... */
232
const btr_pcur_t* cursor);/* in: persistent cursor */
233
233
/*************************************************************
234
234
Sets the mtr field for a pcur. */
322
322
Releases the latch on the current page, and bufferunfixes it.
323
323
Note that there must not be modifications on the current page,
324
324
as then the x-latch can be released only in mtr_commit. */
327
327
btr_pcur_move_to_next_page(
328
328
/*=======================*/
339
339
on return, but it may happen that the cursor is not positioned on the
340
340
last record of any page, because the structure of the tree may have
341
341
changed while the cursor had no latches. */
344
344
btr_pcur_move_backward_from_page(
345
345
/*=============================*/
346
346
btr_pcur_t* cursor, /* in: persistent cursor, must be on the
347
347
first record of the current page */
348
348
mtr_t* mtr); /* in: mtr */
349
350
/*************************************************************
350
351
Returns the btr cursor component of a persistent cursor. */
353
354
btr_pcur_get_btr_cur(
354
355
/*=================*/
355
/* out: pointer to btr cursor component */
356
btr_pcur_t* cursor); /* in: persistent cursor */
357
btr cursor component */
358
const btr_pcur_t* cursor); /* in: persistent cursor */
357
359
/*************************************************************
358
360
Returns the page cursor component of a persistent cursor. */
361
363
btr_pcur_get_page_cur(
362
364
/*==================*/
363
/* out: pointer to page cursor component */
364
btr_pcur_t* cursor); /* in: persistent cursor */
366
page cursor component */
367
const btr_pcur_t* cursor); /* in: persistent cursor */
368
#else /* UNIV_DEBUG */
369
# define btr_pcur_get_btr_cur(cursor) (&(cursor)->btr_cur)
370
# define btr_pcur_get_page_cur(cursor) (&(cursor)->btr_cur.page_cur)
371
#endif /* UNIV_DEBUG */
365
372
/*************************************************************
366
373
Returns the page of a persistent cursor. */
371
378
/* out: pointer to the page */
372
379
btr_pcur_t* cursor);/* in: persistent cursor */
373
380
/*************************************************************
381
Returns the buffer block of a persistent cursor. */
386
/* out: pointer to the block */
387
btr_pcur_t* cursor);/* in: persistent cursor */
388
/*************************************************************
374
389
Returns the record of a persistent cursor. */
385
400
btr_pcur_is_on_user_rec(
386
401
/*====================*/
387
btr_pcur_t* cursor, /* in: persistent cursor */
388
mtr_t* mtr); /* in: mtr */
402
const btr_pcur_t* cursor);/* in: persistent cursor */
389
403
/*************************************************************
390
404
Checks if the persistent cursor is after the last user record on
394
408
btr_pcur_is_after_last_on_page(
395
409
/*===========================*/
396
btr_pcur_t* cursor, /* in: persistent cursor */
397
mtr_t* mtr); /* in: mtr */
410
const btr_pcur_t* cursor);/* in: persistent cursor */
398
411
/*************************************************************
399
412
Checks if the persistent cursor is before the first user record on
403
416
btr_pcur_is_before_first_on_page(
404
417
/*=============================*/
405
btr_pcur_t* cursor, /* in: persistent cursor */
406
mtr_t* mtr); /* in: mtr */
418
const btr_pcur_t* cursor);/* in: persistent cursor */
407
419
/*************************************************************
408
420
Checks if the persistent cursor is before the first user record in
409
421
the index tree. */
429
441
btr_pcur_move_to_next_on_page(
430
442
/*==========================*/
431
btr_pcur_t* cursor, /* in: persistent cursor */
432
mtr_t* mtr); /* in: mtr */
443
btr_pcur_t* cursor);/* in/out: persistent cursor */
433
444
/*************************************************************
434
445
Moves the persistent cursor to the previous record on the same page. */
437
448
btr_pcur_move_to_prev_on_page(
438
449
/*==========================*/
439
btr_pcur_t* cursor, /* in: persistent cursor */
440
mtr_t* mtr); /* in: mtr */
450
btr_pcur_t* cursor);/* in/out: persistent cursor */
443
453
/* The persistent B-tree cursor structure. This is used mainly for SQL
468
478
cursor was on, before, or after the
469
479
old_rec record */
470
480
buf_block_t* block_when_stored;/* buffer block when the position was
471
stored; note that if AWE is on, frames
473
dulint modify_clock; /* the modify clock value of the
482
ib_uint64_t modify_clock; /* the modify clock value of the
474
483
buffer block when the cursor position
476
485
ulint pos_state; /* see TODO note below!