InnoDB Plugin  1.0
Functions
page0cur.ic File Reference
#include "page0page.h"
#include "buf0types.h"
#include "rem0cmp.h"
Include dependency graph for page0cur.ic:
This graph shows which files directly or indirectly include this file:

Functions

UNIV_INLINE page_tpage_cur_get_page (page_cur_t *cur)
UNIV_INLINE buf_block_tpage_cur_get_block (page_cur_t *cur)
UNIV_INLINE page_zip_des_tpage_cur_get_page_zip (page_cur_t *cur)
UNIV_INLINE rec_t * page_cur_get_rec (page_cur_t *cur)
UNIV_INLINE void page_cur_set_before_first (const buf_block_t *block, page_cur_t *cur)
UNIV_INLINE void page_cur_set_after_last (const buf_block_t *block, page_cur_t *cur)
UNIV_INLINE ibool page_cur_is_before_first (const page_cur_t *cur)
UNIV_INLINE ibool page_cur_is_after_last (const page_cur_t *cur)
UNIV_INLINE void page_cur_position (const rec_t *rec, const buf_block_t *block, page_cur_t *cur)
UNIV_INLINE void page_cur_invalidate (page_cur_t *cur)
UNIV_INLINE void page_cur_move_to_next (page_cur_t *cur)
UNIV_INLINE void page_cur_move_to_prev (page_cur_t *cur)
UNIV_INLINE ulint page_cur_search (const buf_block_t *block, const dict_index_t *index, const dtuple_t *tuple, ulint mode, page_cur_t *cursor)
UNIV_INLINE rec_t * page_cur_tuple_insert (page_cur_t *cursor, const dtuple_t *tuple, dict_index_t *index, ulint **offsets, mem_heap_t **heap, ulint n_ext, mtr_t *mtr)
UNIV_INLINE rec_t * page_cur_rec_insert (page_cur_t *cursor, const rec_t *rec, dict_index_t *index, ulint *offsets, mtr_t *mtr)

Detailed Description

The page cursor

Created 10/4/1994 Heikki Tuuri

Function Documentation

UNIV_INLINE buf_block_t* page_cur_get_block ( page_cur_t cur)

Gets pointer to the buffer block where the cursor is positioned.

Returns
page
Parameters
curin: page cursor
UNIV_INLINE page_t* page_cur_get_page ( page_cur_t cur)

Gets pointer to the page frame where the cursor is positioned.

Returns
page
Parameters
curin: page cursor
UNIV_INLINE page_zip_des_t* page_cur_get_page_zip ( page_cur_t cur)

Gets pointer to the page frame where the cursor is positioned.

Returns
page
Parameters
curin: page cursor
UNIV_INLINE rec_t* page_cur_get_rec ( page_cur_t cur)

Gets the record where the cursor is positioned.

Returns
record
Parameters
curin: page cursor
UNIV_INLINE void page_cur_invalidate ( page_cur_t cur)

Invalidates a page cursor by setting the record pointer NULL.

Parameters
curout: page cursor
UNIV_INLINE ibool page_cur_is_after_last ( const page_cur_t cur)

Returns TRUE if the cursor is after last user record.

Returns
TRUE if at end
Parameters
curin: cursor
UNIV_INLINE ibool page_cur_is_before_first ( const page_cur_t cur)

Returns TRUE if the cursor is before first user record on page.

Returns
TRUE if at start
Parameters
curin: cursor
UNIV_INLINE void page_cur_move_to_next ( page_cur_t cur)

Moves the cursor to the next record on page.

Parameters
curin/out: cursor; must not be after last
UNIV_INLINE void page_cur_move_to_prev ( page_cur_t cur)

Moves the cursor to the previous record on page.

Parameters
curin/out: page cursor, not before first
UNIV_INLINE void page_cur_position ( const rec_t *  rec,
const buf_block_t block,
page_cur_t cur 
)

Positions the cursor on the given record.

Parameters
recin: record on a page
blockin: buffer block containing the record
curout: page cursor
UNIV_INLINE rec_t* page_cur_rec_insert ( page_cur_t cursor,
const rec_t *  rec,
dict_index_t index,
ulint *  offsets,
mtr_t mtr 
)

Inserts a record next to page cursor. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same logical position, but the physical position may change if it is pointing to a compressed page that was reorganized.

IMPORTANT: The caller will have to update IBUF_BITMAP_FREE if this is a compressed leaf page in a secondary index. This has to be done either within the same mini-transaction, or by invoking ibuf_reset_free_bits() before mtr_commit().

Returns
pointer to record if succeed, NULL otherwise
Parameters
cursorin/out: a page cursor
recin: record to insert
indexin: record descriptor
offsetsin/out: rec_get_offsets(rec, index)
mtrin: mini-transaction handle, or NULL
UNIV_INLINE ulint page_cur_search ( const buf_block_t block,
const dict_index_t index,
const dtuple_t tuple,
ulint  mode,
page_cur_t cursor 
)

Searches the right position for a page cursor.

Returns
number of matched fields on the left
Parameters
blockin: buffer block
indexin: record descriptor
tuplein: data tuple
modein: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE
cursorout: page cursor
UNIV_INLINE void page_cur_set_after_last ( const buf_block_t block,
page_cur_t cur 
)

Sets the cursor object to point after the last user record on the page.

Parameters
blockin: index page
curin: cursor
UNIV_INLINE void page_cur_set_before_first ( const buf_block_t block,
page_cur_t cur 
)

Sets the cursor object to point before the first user record on the page.

Parameters
blockin: index page
curin: cursor
UNIV_INLINE rec_t* page_cur_tuple_insert ( page_cur_t cursor,
const dtuple_t tuple,
dict_index_t index,
ulint **  offsets,
mem_heap_t **  heap,
ulint  n_ext,
mtr_t mtr 
)

Inserts a record next to page cursor. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same logical position, but the physical position may change if it is pointing to a compressed page that was reorganized.

IMPORTANT: The caller will have to update IBUF_BITMAP_FREE if this is a compressed leaf page in a secondary index. This has to be done either within the same mini-transaction, or by invoking ibuf_reset_free_bits() before mtr_commit().

Returns
pointer to record if succeed, NULL otherwise
Parameters
cursorin/out: a page cursor
tuplein: pointer to a data tuple
indexin: record descriptor
offsetsout: offsets on *rec
heapin/out: pointer to memory heap, or NULL
n_extin: number of externally stored columns
mtrin: mini-transaction handle, or NULL