drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
page0cur.h File Reference
#include "univ.i"
#include "buf0types.h"
#include "page0page.h"
#include "rem0rec.h"
#include "data0data.h"
#include "mtr0mtr.h"
Include dependency graph for page0cur.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  page_cur_struct

Macros

#define page0cur_h
#define PAGE_CUR_ADAPT
#define PAGE_CUR_UNSUPP   0
#define PAGE_CUR_G   1
#define PAGE_CUR_GE   2
#define PAGE_CUR_L   3
#define PAGE_CUR_LE   4
#define page_cur_get_page(cur)
#define page_cur_get_block(cur)
#define page_cur_get_page_zip(cur)
#define page_cur_get_rec(cur)

Functions

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 rec_t * page_cur_tuple_insert (page_cur_t *cursor, const dtuple_t *tuple, dict_index_t *index, 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)
UNIV_INTERN rec_t * page_cur_insert_rec_low (rec_t *current_rec, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
UNIV_INTERN rec_t * page_cur_insert_rec_zip (rec_t **current_rec, buf_block_t *block, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
UNIV_INTERN void page_copy_rec_list_end_to_created_page (page_t *new_page, rec_t *rec, dict_index_t *index, mtr_t *mtr)
UNIV_INTERN void page_cur_delete_rec (page_cur_t *cursor, dict_index_t *index, const ulint *offsets, mtr_t *mtr)
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_INTERN void page_cur_search_with_match (const buf_block_t *block, const dict_index_t *index, const dtuple_t *tuple, ulint mode, ulint *iup_matched_fields, ulint *iup_matched_bytes, ulint *ilow_matched_fields, ulint *ilow_matched_bytes, page_cur_t *cursor)
UNIV_INTERN void page_cur_open_on_rnd_user_rec (buf_block_t *block, page_cur_t *cursor)
UNIV_INTERN byte * page_cur_parse_insert_rec (ibool is_short, byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
UNIV_INTERN byte * page_parse_copy_rec_list_to_created_page (byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
UNIV_INTERN byte * page_cur_parse_delete_rec (byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)

Detailed Description

The page cursor

Created 10/4/1994 Heikki Tuuri

Definition in file page0cur.h.

Macro Definition Documentation

◆ page0cur_h

#define page0cur_h

Definition at line 28 of file page0cur.h.

◆ PAGE_CUR_ADAPT

#define PAGE_CUR_ADAPT

Definition at line 39 of file page0cur.h.

◆ PAGE_CUR_G

#define PAGE_CUR_G   1

Definition at line 44 of file page0cur.h.

◆ PAGE_CUR_GE

#define PAGE_CUR_GE   2

Definition at line 45 of file page0cur.h.

◆ page_cur_get_block

#define page_cur_get_block ( cur)
Value:
(cur)->block

Definition at line 91 of file page0cur.h.

◆ page_cur_get_page

#define page_cur_get_page ( cur)
Value:
page_align((cur)->rec)
UNIV_INLINE page_t * page_align(const void *ptr) __attribute__((const))

Definition at line 90 of file page0cur.h.

◆ page_cur_get_page_zip

#define page_cur_get_page_zip ( cur)
Value:
#define buf_block_get_page_zip(block)
Definition buf0buf.h:1021

Definition at line 92 of file page0cur.h.

◆ page_cur_get_rec

#define page_cur_get_rec ( cur)
Value:
(cur)->rec

Definition at line 93 of file page0cur.h.

◆ PAGE_CUR_L

#define PAGE_CUR_L   3

Definition at line 46 of file page0cur.h.

◆ PAGE_CUR_LE

#define PAGE_CUR_LE   4

Definition at line 47 of file page0cur.h.

◆ PAGE_CUR_UNSUPP

#define PAGE_CUR_UNSUPP   0

Definition at line 43 of file page0cur.h.

Function Documentation

◆ page_copy_rec_list_end_to_created_page()

UNIV_INTERN void page_copy_rec_list_end_to_created_page ( page_t * new_page,
rec_t * rec,
dict_index_t * index,
mtr_t * mtr )

Copies records from page to a newly created page, from a given record onward, including that record. Infimum and supremum records are not copied. in: mtr

Copies records from page to a newly created page, from a given record onward, including that record. Infimum and supremum records are not copied.

Parameters
new_pagein/out: index page to copy to
recin: first record to copy
indexin: record descriptor
mtrin: mtr

Definition at line 1599 of file page0cur.cc.

◆ page_cur_delete_rec()

UNIV_INTERN void page_cur_delete_rec ( page_cur_t * cursor,
dict_index_t * index,
const ulint * offsets,
mtr_t * mtr )

Deletes a record at the page cursor. The cursor is moved to the next record after the deleted one. in: mini-transaction handle

Deletes a record at the page cursor. The cursor is moved to the next record after the deleted one.

Parameters
cursorin/out: a page cursor
indexin: record descriptor
offsetsin: rec_get_offsets(cursor->rec, index)
mtrin: mini-transaction handle

Definition at line 1858 of file page0cur.cc.

◆ page_cur_insert_rec_low()

UNIV_INTERN rec_t * page_cur_insert_rec_low ( rec_t * current_rec,
dict_index_t * index,
const rec_t * rec,
ulint * offsets,
mtr_t * mtr )

Inserts a record next to page cursor on an uncompressed page. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same position.

Returns
pointer to record if succeed, NULL otherwise in: mini-transaction handle, or NULL

Inserts a record next to page cursor on an uncompressed page. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same position.

Returns
pointer to record if succeed, NULL otherwise

< the relevant page

< cursor position at previous insert

< a free record that was reused, or NULL

< inserted record

< heap number of the inserted record

Parameters
current_recin: pointer to current record after which the new record is inserted
indexin: record descriptor
recin: pointer to a physical record
offsetsin/out: rec_get_offsets(rec, index)
mtrin: mini-transaction handle, or NULL

Definition at line 950 of file page0cur.cc.

◆ page_cur_insert_rec_zip()

UNIV_INTERN rec_t * page_cur_insert_rec_zip ( rec_t ** current_rec,
buf_block_t * block,
dict_index_t * index,
const rec_t * rec,
ulint * offsets,
mtr_t * mtr )

Inserts a record next to page cursor on a compressed and uncompressed page. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same position.

Returns
pointer to record if succeed, NULL otherwise in: mini-transaction handle, or NULL

Inserts a record next to page cursor on a compressed and uncompressed page. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same position.

Returns
pointer to record if succeed, NULL otherwise

< the relevant page

< cursor position at previous insert

< a free record that was reused, or NULL

< inserted record

< heap number of the inserted record

Parameters
current_recin/out: pointer to current record after which the new record is inserted
blockin: buffer block of *current_rec
indexin: record descriptor
recin: pointer to a physical record
offsetsin/out: rec_get_offsets(rec, index)
mtrin: mini-transaction handle, or NULL

Definition at line 1217 of file page0cur.cc.

◆ page_cur_invalidate()

UNIV_INLINE void page_cur_invalidate ( page_cur_t * cur)

Invalidates a page cursor by setting the record pointer NULL. out: page cursor

◆ page_cur_is_after_last()

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 in: cursor

◆ page_cur_is_before_first()

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 in: cursor

◆ page_cur_move_to_next()

UNIV_INLINE void page_cur_move_to_next ( page_cur_t * cur)

Moves the cursor to the next record on page. in/out: cursor; must not be after last

◆ page_cur_move_to_prev()

UNIV_INLINE void page_cur_move_to_prev ( page_cur_t * cur)

Moves the cursor to the previous record on page. in/out: cursor; not before first

◆ page_cur_open_on_rnd_user_rec()

UNIV_INTERN void page_cur_open_on_rnd_user_rec ( buf_block_t * block,
page_cur_t * cursor )

Positions a page cursor on a randomly chosen user record on a page. If there are no user records, sets the cursor on the infimum record. out: page cursor

Positions a page cursor on a randomly chosen user record on a page. If there are no user records, sets the cursor on the infimum record.

Parameters
blockin: page
cursorout: page cursor

Definition at line 545 of file page0cur.cc.

◆ page_cur_parse_delete_rec()

UNIV_INTERN byte * page_cur_parse_delete_rec ( byte * ptr,
byte * end_ptr,
buf_block_t * block,
dict_index_t * index,
mtr_t * mtr )

Parses log record of a record delete on a page.

Returns
pointer to record end or NULL in: mtr or NULL

Parses log record of a record delete on a page.

Returns
pointer to record end or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
blockin: page or NULL
indexin: record descriptor
mtrin: mtr or NULL

Definition at line 1809 of file page0cur.cc.

◆ page_cur_parse_insert_rec()

UNIV_INTERN byte * page_cur_parse_insert_rec ( ibool is_short,
byte * ptr,
byte * end_ptr,
buf_block_t * block,
dict_index_t * index,
mtr_t * mtr )

Parses a log record of a record insert on a page.

Returns
end of log record or NULL in: mtr or NULL

Parses a log record of a record insert on a page.

Returns
end of log record or NULL
Parameters
is_shortin: TRUE if short inserts
ptrin: buffer
end_ptrin: buffer end
blockin: page or NULL
indexin: record descriptor
mtrin: mtr or NULL

Definition at line 757 of file page0cur.cc.

◆ page_cur_position()

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. out: page cursor

Parameters
recin: record on a page
blockin: buffer block containing the record

◆ page_cur_rec_insert()

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.

Returns
pointer to record if succeed, NULL otherwise in: mini-transaction handle, or NULL
Parameters
cursorin/out: a page cursor
recin: record to insert
indexin: record descriptor
offsetsin/out: rec_get_offsets(rec, index)

◆ page_cur_search()

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 out: page cursor
Parameters
blockin: buffer block
indexin: record descriptor
tuplein: data tuple
modein: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE

◆ page_cur_search_with_match()

UNIV_INTERN void page_cur_search_with_match ( const buf_block_t * block,
const dict_index_t * index,
const dtuple_t * tuple,
ulint mode,
ulint * iup_matched_fields,
ulint * iup_matched_bytes,
ulint * ilow_matched_fields,
ulint * ilow_matched_bytes,
page_cur_t * cursor )

Searches the right position for a page cursor. out: page cursor

Searches the right position for a page cursor.

Parameters
blockin: buffer block
indexin: record descriptor
tuplein: data tuple
modein: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE
iup_matched_fieldsin/out: already matched fields in upper limit record
iup_matched_bytesin/out: already matched bytes in a field not yet completely matched
ilow_matched_fieldsin/out: already matched fields in lower limit record
ilow_matched_bytesin/out: already matched bytes in a field not yet completely matched
cursorout: page cursor

Definition at line 246 of file page0cur.cc.

◆ page_cur_set_after_last()

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. in: cursor

Parameters
blockin: index page

◆ page_cur_set_before_first()

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. in: cursor

Parameters
blockin: index page

◆ page_cur_tuple_insert()

UNIV_INLINE rec_t * page_cur_tuple_insert ( page_cur_t * cursor,
const dtuple_t * tuple,
dict_index_t * index,
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.

Returns
pointer to record if succeed, NULL otherwise in: mini-transaction handle, or NULL
Parameters
cursorin/out: a page cursor
tuplein: pointer to a data tuple
indexin: record descriptor
n_extin: number of externally stored columns

◆ page_parse_copy_rec_list_to_created_page()

UNIV_INTERN byte * page_parse_copy_rec_list_to_created_page ( byte * ptr,
byte * end_ptr,
buf_block_t * block,
dict_index_t * index,
mtr_t * mtr )

Parses a log record of copying a record list end to a new created page.

Returns
end of log record or NULL in: mtr or NULL

Parses a log record of copying a record list end to a new created page.

Returns
end of log record or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
blockin: page or NULL
indexin: record descriptor
mtrin: mtr or NULL

Definition at line 1542 of file page0cur.cc.