MySQL 5.6.14 Source Code Document
|
Go to the source code of this file.
Functions | |
UNIV_INTERN btr_pcur_t * | btr_pcur_create_for_mysql (void) |
UNIV_INTERN void | btr_pcur_reset (btr_pcur_t *cursor) |
UNIV_INTERN void | btr_pcur_free_for_mysql (btr_pcur_t *cursor) |
UNIV_INTERN void | btr_pcur_store_position (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INTERN void | btr_pcur_copy_stored_position (btr_pcur_t *pcur_receive, btr_pcur_t *pcur_donate) |
UNIV_INTERN ibool | btr_pcur_restore_position_func (ulint latch_mode, btr_pcur_t *cursor, const char *file, ulint line, mtr_t *mtr) |
UNIV_INTERN void | btr_pcur_move_to_next_page (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INTERN void | btr_pcur_move_backward_from_page (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INTERN ibool | btr_pcur_move_to_prev (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INTERN void | btr_pcur_open_on_user_rec_func (dict_index_t *index, const dtuple_t *tuple, ulint mode, ulint latch_mode, btr_pcur_t *cursor, const char *file, ulint line, mtr_t *mtr) |
UNIV_INTERN void btr_pcur_copy_stored_position | ( | btr_pcur_t * | pcur_receive, |
btr_pcur_t * | pcur_donate | ||
) |
Copies the stored position of a pcur to another pcur.
pcur_receive | in: pcur which will receive the position info |
pcur_donate | in: pcur from which the info is copied |
Definition at line 179 of file btr0pcur.cc.
UNIV_INTERN btr_pcur_t* btr_pcur_create_for_mysql | ( | void | ) |
Allocates memory for a persistent cursor object and initializes the cursor.
Definition at line 41 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_free_for_mysql | ( | btr_pcur_t * | cursor | ) |
Frees the memory for a persistent cursor object.
cursor | in, own: persistent cursor |
Definition at line 84 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_move_backward_from_page | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor backward if it is on the first record of the page. Commits mtr. Note that to prevent a possible deadlock, the operation first stores the position of the cursor, commits mtr, acquires the necessary latches and restores the cursor position again before returning. The alphabetical position of the cursor is guaranteed to be sensible on return, but it may happen that the cursor is not positioned on the last record of any page, because the structure of the tree may have changed during the time when the cursor had no latches.
cursor | in: persistent cursor, must be on the first record of the current page |
mtr | in: mtr |
Definition at line 462 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_move_to_next_page | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor to the first record on the next page. Releases the latch on the current page, and bufferunfixes it. Note that there must not be modifications on the current page, as then the x-latch can be released only in mtr_commit.
cursor | in: persistent cursor; must be on the last record of the current page |
mtr | in: mtr |
Definition at line 406 of file btr0pcur.cc.
UNIV_INTERN ibool btr_pcur_move_to_prev | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor to the previous record in the tree. If no records are left, the cursor stays 'before first in tree'.
cursor | in: persistent cursor; NOTE that the function may release the page latch |
mtr | in: mtr |
Definition at line 537 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_open_on_user_rec_func | ( | dict_index_t * | index, |
const dtuple_t * | tuple, | ||
ulint | mode, | ||
ulint | latch_mode, | ||
btr_pcur_t * | cursor, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first user record satisfying the search condition, in the case PAGE_CUR_L or PAGE_CUR_LE, on the last user record. If no such user record exists, then in the first case sets the cursor after last in tree, and in the latter case before first in tree. The latching mode must be BTR_SEARCH_LEAF or BTR_MODIFY_LEAF.
index | in: index |
tuple | in: tuple on which search done |
mode | in: PAGE_CUR_L, ... |
latch_mode | in: BTR_SEARCH_LEAF or BTR_MODIFY_LEAF |
cursor | in: memory buffer for persistent cursor |
file | in: file name |
line | in: line where called |
mtr | in: mtr |
Definition at line 574 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_reset | ( | btr_pcur_t * | cursor | ) |
Resets a persistent cursor object, freeing ::old_rec_buf if it is allocated and resetting the other members to their initial values.
cursor | in, out: persistent cursor |
Definition at line 59 of file btr0pcur.cc.
UNIV_INTERN ibool btr_pcur_restore_position_func | ( | ulint | latch_mode, |
btr_pcur_t * | cursor, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
Restores the stored position of a persistent cursor bufferfixing the page and obtaining the specified latches. If the cursor position was saved when the (1) cursor was positioned on a user record: this function restores the position to the last record LESS OR EQUAL to the stored record; (2) cursor was positioned on a page infimum record: restores the position to the last record LESS than the user record which was the successor of the page infimum; (3) cursor was positioned on the page supremum: restores to the first record GREATER than the user record which was the predecessor of the supremum. (4) cursor was positioned before the first or after the last in an empty tree: restores to before first or after the last in the tree.
latch_mode | in: BTR_SEARCH_LEAF, ... |
cursor | in: detached persistent cursor |
file | in: file name |
line | in: line where called |
mtr | in: mtr |
Definition at line 223 of file btr0pcur.cc.
UNIV_INTERN void btr_pcur_store_position | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
The position of the cursor is stored by taking an initial segment of the record the cursor is positioned on, before, or after, and copying it to the cursor data structure, or just setting a flag if the cursor id before the first in an EMPTY tree, or after the last in an EMPTY tree. NOTE that the page where the cursor is positioned must not be empty if the index tree is not totally empty!
cursor | in: persistent cursor |
mtr | in: mtr |
Definition at line 101 of file btr0pcur.cc.