InnoDB Plugin
1.0
|
Functions | |
UNIV_INLINE ulint | btr_pcur_get_rel_pos (const btr_pcur_t *cursor) |
UNIV_INLINE btr_cur_t * | btr_pcur_get_btr_cur (const btr_pcur_t *cursor) |
UNIV_INLINE page_cur_t * | btr_pcur_get_page_cur (const btr_pcur_t *cursor) |
UNIV_INLINE page_t * | btr_pcur_get_page (const btr_pcur_t *cursor) |
UNIV_INLINE buf_block_t * | btr_pcur_get_block (const btr_pcur_t *cursor) |
UNIV_INLINE rec_t * | btr_pcur_get_rec (const btr_pcur_t *cursor) |
UNIV_INLINE ulint | btr_pcur_get_up_match (const btr_pcur_t *cursor) |
UNIV_INLINE ulint | btr_pcur_get_low_match (const btr_pcur_t *cursor) |
UNIV_INLINE ibool | btr_pcur_is_after_last_on_page (const btr_pcur_t *cursor) |
UNIV_INLINE ibool | btr_pcur_is_before_first_on_page (const btr_pcur_t *cursor) |
UNIV_INLINE ibool | btr_pcur_is_on_user_rec (const btr_pcur_t *cursor) |
UNIV_INLINE ibool | btr_pcur_is_before_first_in_tree (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INLINE ibool | btr_pcur_is_after_last_in_tree (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_move_to_next_on_page (btr_pcur_t *cursor) |
UNIV_INLINE void | btr_pcur_move_to_prev_on_page (btr_pcur_t *cursor) |
UNIV_INLINE void | btr_pcur_move_to_last_on_page (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INLINE ibool | btr_pcur_move_to_next_user_rec (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INLINE ibool | btr_pcur_move_to_next (btr_pcur_t *cursor, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_commit_specify_mtr (btr_pcur_t *pcur, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_init (btr_pcur_t *pcur) |
UNIV_INLINE void | btr_pcur_open_low (dict_index_t *index, ulint level, const dtuple_t *tuple, ulint mode, ulint latch_mode, btr_pcur_t *cursor, const char *file, ulint line, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_open_with_no_init_func (dict_index_t *index, const dtuple_t *tuple, ulint mode, ulint latch_mode, btr_pcur_t *cursor, ulint has_search_latch, const char *file, ulint line, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_open_at_index_side (bool from_left, dict_index_t *index, ulint latch_mode, btr_pcur_t *pcur, bool init_pcur, ulint level, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_open_at_rnd_pos_func (dict_index_t *index, ulint latch_mode, btr_pcur_t *cursor, const char *file, ulint line, mtr_t *mtr) |
UNIV_INLINE void | btr_pcur_close (btr_pcur_t *cursor) |
UNIV_INLINE void | btr_pcur_move_before_first_on_page (btr_pcur_t *cursor) |
The index tree persistent cursor
Created 2/23/1996 Heikki Tuuri
UNIV_INLINE void btr_pcur_close | ( | btr_pcur_t * | cursor | ) |
Frees the possible memory heap of a persistent cursor and sets the latch mode of the persistent cursor to BTR_NO_LATCHES. WARNING: this function does not release the latch on the page where the cursor is currently positioned. The latch is acquired by the "move to next/previous" family of functions. Since recursive shared locks are not allowed, you must take care (if using the cursor in S-mode) to manually release the latch by either calling btr_leaf_page_release(btr_pcur_get_block(&pcur), pcur.latch_mode, mtr) or by committing the mini-transaction right after btr_pcur_close(). A subsequent attempt to crawl the same page in the same mtr would cause an assertion failure.
cursor | in: persistent cursor |
UNIV_INLINE void btr_pcur_commit_specify_mtr | ( | btr_pcur_t * | pcur, |
mtr_t * | mtr | ||
) |
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES, that is, the cursor becomes detached. Function btr_pcur_store_position should be used before calling this, if restoration of cursor is wanted later.
pcur | in: persistent cursor |
mtr | in: mtr to commit |
UNIV_INLINE buf_block_t* btr_pcur_get_block | ( | const btr_pcur_t * | cursor | ) |
Returns the buffer block of a persistent cursor.
cursor | in: persistent cursor |
UNIV_INLINE btr_cur_t* btr_pcur_get_btr_cur | ( | const btr_pcur_t * | cursor | ) |
Returns the btr cursor component of a persistent cursor.
cursor | in: persistent cursor |
UNIV_INLINE ulint btr_pcur_get_low_match | ( | const btr_pcur_t * | cursor | ) |
Gets the low_match value for a pcur after a search.
cursor | in: persistent cursor |
UNIV_INLINE page_t* btr_pcur_get_page | ( | const btr_pcur_t * | cursor | ) |
Returns the page of a persistent cursor.
cursor | in: persistent cursor |
UNIV_INLINE page_cur_t* btr_pcur_get_page_cur | ( | const btr_pcur_t * | cursor | ) |
Returns the page cursor component of a persistent cursor.
cursor | in: persistent cursor |
UNIV_INLINE rec_t* btr_pcur_get_rec | ( | const btr_pcur_t * | cursor | ) |
Returns the record of a persistent cursor.
cursor | in: persistent cursor |
UNIV_INLINE ulint btr_pcur_get_rel_pos | ( | const btr_pcur_t * | cursor | ) |
Gets the rel_pos field for a cursor whose position has been stored.
cursor | in: persistent cursor |
UNIV_INLINE ulint btr_pcur_get_up_match | ( | const btr_pcur_t * | cursor | ) |
Gets the up_match value for a pcur after a search.
cursor | in: persistent cursor |
UNIV_INLINE void btr_pcur_init | ( | btr_pcur_t * | pcur | ) |
Sets the old_rec_buf field to NULL.
pcur | in: persistent cursor |
UNIV_INLINE ibool btr_pcur_is_after_last_in_tree | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Checks if the persistent cursor is after the last user record in the index tree.
cursor | in: persistent cursor |
mtr | in: mtr |
UNIV_INLINE ibool btr_pcur_is_after_last_on_page | ( | const btr_pcur_t * | cursor | ) |
Checks if the persistent cursor is after the last user record on a page.
cursor | in: persistent cursor |
UNIV_INLINE ibool btr_pcur_is_before_first_in_tree | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Checks if the persistent cursor is before the first user record in the index tree.
cursor | in: persistent cursor |
mtr | in: mtr |
UNIV_INLINE ibool btr_pcur_is_before_first_on_page | ( | const btr_pcur_t * | cursor | ) |
Checks if the persistent cursor is before the first user record on a page.
cursor | in: persistent cursor |
UNIV_INLINE ibool btr_pcur_is_on_user_rec | ( | const btr_pcur_t * | cursor | ) |
Checks if the persistent cursor is on a user record.
cursor | in: persistent cursor |
UNIV_INLINE void btr_pcur_move_before_first_on_page | ( | btr_pcur_t * | cursor | ) |
Moves the persistent cursor to the infimum record on the same page.
cursor | in/out: persistent cursor |
UNIV_INLINE void btr_pcur_move_to_last_on_page | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor to the last record on the same page.
cursor | in: persistent cursor |
mtr | in: mtr |
UNIV_INLINE ibool btr_pcur_move_to_next | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor to the next record in the tree. If no records are left, the cursor stays 'after last in tree'.
cursor | in: persistent cursor; NOTE that the function may release the page latch |
mtr | in: mtr |
UNIV_INLINE void btr_pcur_move_to_next_on_page | ( | btr_pcur_t * | cursor | ) |
Moves the persistent cursor to the next record on the same page.
cursor | in/out: persistent cursor |
UNIV_INLINE ibool btr_pcur_move_to_next_user_rec | ( | btr_pcur_t * | cursor, |
mtr_t * | mtr | ||
) |
Moves the persistent cursor to the next user record in the tree. If no user records are left, the cursor ends up 'after last in tree'.
cursor | in: persistent cursor; NOTE that the function may release the page latch |
mtr | in: mtr |
UNIV_INLINE void btr_pcur_move_to_prev_on_page | ( | btr_pcur_t * | cursor | ) |
Moves the persistent cursor to the previous record on the same page.
cursor | in/out: persistent cursor |
UNIV_INLINE void btr_pcur_open_at_index_side | ( | bool | from_left, |
dict_index_t * | index, | ||
ulint | latch_mode, | ||
btr_pcur_t * | pcur, | ||
bool | init_pcur, | ||
ulint | level, | ||
mtr_t * | mtr | ||
) |
Opens a persistent cursor at either end of an index.
from_left | in: true if open to the low end, false if to the high end |
index | in: index |
latch_mode | in: latch mode |
pcur | in/out: cursor |
init_pcur | in: whether to initialize pcur |
level | in: level to search for (0=leaf) |
mtr | in/out: mini-transaction |
UNIV_INLINE void btr_pcur_open_at_rnd_pos_func | ( | dict_index_t * | index, |
ulint | latch_mode, | ||
btr_pcur_t * | cursor, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
Positions a cursor at a randomly chosen position within a B-tree.
index | in: index |
latch_mode | in: BTR_SEARCH_LEAF, ... |
cursor | in/out: B-tree pcur |
file | in: file name |
line | in: line where called |
mtr | in: mtr |
UNIV_INLINE void btr_pcur_open_low | ( | dict_index_t * | index, |
ulint | level, | ||
const dtuple_t * | tuple, | ||
ulint | mode, | ||
ulint | latch_mode, | ||
btr_pcur_t * | cursor, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
Initializes and opens a persistent cursor to an index tree. It should be closed with btr_pcur_close.
index | in: index |
level | in: level in the btree |
tuple | in: tuple on which search done |
mode | in: PAGE_CUR_L, ...; NOTE that if the search is made using a unique prefix of a record, mode should be PAGE_CUR_LE, not PAGE_CUR_GE, as the latter may end up on the previous page from the record! |
latch_mode | in: BTR_SEARCH_LEAF, ... |
cursor | in: memory buffer for persistent cursor |
file | in: file name |
line | in: line where called |
mtr | in: mtr |
UNIV_INLINE void btr_pcur_open_with_no_init_func | ( | dict_index_t * | index, |
const dtuple_t * | tuple, | ||
ulint | mode, | ||
ulint | latch_mode, | ||
btr_pcur_t * | cursor, | ||
ulint | has_search_latch, | ||
const char * | file, | ||
ulint | line, | ||
mtr_t * | mtr | ||
) |
Opens an persistent cursor to an index tree without initializing the cursor.
index | in: index |
tuple | in: tuple on which search done |
mode | in: PAGE_CUR_L, ...; NOTE that if the search is made using a unique prefix of a record, mode should be PAGE_CUR_LE, not PAGE_CUR_GE, as the latter may end up on the previous page of the record! |
latch_mode | in: BTR_SEARCH_LEAF, ...; NOTE that if has_search_latch != 0 then we maybe do not acquire a latch on the cursor page, but assume that the caller uses his btr search latch to protect the record! |
cursor | in: memory buffer for persistent cursor |
has_search_latch | in: latch mode the caller currently has on btr_search_latch: RW_S_LATCH, or 0 |
file | in: file name |
line | in: line where called |
mtr | in: mtr |