MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
page0cur.cc File Reference
#include "page0cur.h"
#include "page0zip.h"
#include "btr0btr.h"
#include "mtr0log.h"
#include "log0recv.h"
#include "ut0ut.h"
#include "rem0cmp.h"
Include dependency graph for page0cur.cc:

Go to the source code of this file.

Functions

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 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 (page_cur_t *cursor, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
UNIV_INLINE byte * page_copy_rec_list_to_created_page_write_log (page_t *page, 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 void page_copy_rec_list_end_to_created_page (page_t *new_page, rec_t *rec, dict_index_t *index, mtr_t *mtr)
UNIV_INLINE void page_cur_delete_rec_write_log (rec_t *rec, const 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)
UNIV_INTERN void page_cur_delete_rec (page_cur_t *cursor, const dict_index_t *index, const ulint *offsets, mtr_t *mtr)

Detailed Description

The page cursor

Created 10/4/1994 Heikki Tuuri

Definition in file page0cur.cc.

Function Documentation

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.

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().

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

Definition at line 1715 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INLINE byte* page_copy_rec_list_to_created_page_write_log ( page_t page,
dict_index_t index,
mtr_t mtr 
)

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

Returns
4-byte field where to write the log data length, or NULL if logging is disabled
Parameters
pagein: index page
indexin: record descriptor
mtrin: mtr

Definition at line 1626 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void page_cur_delete_rec ( page_cur_t cursor,
const 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.

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

Definition at line 1974 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INLINE void page_cur_delete_rec_write_log ( rec_t *  rec,
const dict_index_t index,
mtr_t mtr 
)

Writes log record of a record delete on a page.

Parameters
recin: record to be deleted
indexin: record descriptor
mtrin: mini-transaction handle

Definition at line 1890 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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

< 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 953 of file page0cur.cc.

Here is the call graph for this function:

UNIV_INTERN rec_t* page_cur_insert_rec_zip ( page_cur_t cursor,
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.

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

< 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
cursorin/out: page cursor
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 1177 of file page0cur.cc.

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.

Parameters
blockin: page
cursorout: page cursor

Definition at line 547 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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
Parameters
ptrin: buffer
end_ptrin: buffer end
blockin: page or NULL
indexin: record descriptor
mtrin: mtr or NULL

Definition at line 1925 of file page0cur.cc.

Here is the call graph for this function:

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
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 759 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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 248 of file page0cur.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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
Parameters
ptrin: buffer
end_ptrin: buffer end
blockin: page or NULL
indexin: record descriptor
mtrin: mtr or NULL

Definition at line 1653 of file page0cur.cc.

Here is the call graph for this function: