#include "univ.i"
#include "page0types.h"
#include "fil0fil.h"
#include "buf0buf.h"
#include "data0data.h"
#include "dict0dict.h"
#include "rem0rec.h"
#include "fsp0fsp.h"
#include "mtr0mtr.h"
Go to the source code of this file.
Macros | |
#define | page0page_h |
#define | PAGE_HEADER |
#define | PAGE_N_DIR_SLOTS 0 /* number of slots in page directory */ |
#define | PAGE_HEAP_TOP 2 /* pointer to record heap top */ |
#define | PAGE_N_HEAP |
#define | PAGE_FREE 6 /* pointer to start of page free record list */ |
#define | PAGE_GARBAGE 8 /* number of bytes in deleted records */ |
#define | PAGE_LAST_INSERT |
#define | PAGE_DIRECTION 12 /* last insert direction: PAGE_LEFT, ... */ |
#define | PAGE_N_DIRECTION |
#define | PAGE_N_RECS 16 /* number of user records on the page */ |
#define | PAGE_MAX_TRX_ID |
#define | PAGE_HEADER_PRIV_END |
#define | PAGE_LEVEL |
#define | PAGE_INDEX_ID |
#define | PAGE_BTR_SEG_LEAF |
#define | PAGE_BTR_IBUF_FREE_LIST PAGE_BTR_SEG_LEAF |
#define | PAGE_BTR_IBUF_FREE_LIST_NODE PAGE_BTR_SEG_LEAF |
#define | PAGE_BTR_SEG_TOP (36 + FSEG_HEADER_SIZE) |
#define | PAGE_DATA (PAGE_HEADER + 36 + 2 * FSEG_HEADER_SIZE) |
#define | PAGE_OLD_INFIMUM (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES) |
#define | PAGE_OLD_SUPREMUM (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8) |
#define | PAGE_OLD_SUPREMUM_END (PAGE_OLD_SUPREMUM + 9) |
#define | PAGE_NEW_INFIMUM (PAGE_DATA + REC_N_NEW_EXTRA_BYTES) |
#define | PAGE_NEW_SUPREMUM (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8) |
#define | PAGE_NEW_SUPREMUM_END (PAGE_NEW_SUPREMUM + 8) |
#define | PAGE_HEAP_NO_INFIMUM 0 /* page infimum */ |
#define | PAGE_HEAP_NO_SUPREMUM 1 /* page supremum */ |
#define | PAGE_HEAP_NO_USER_LOW |
#define | PAGE_LEFT 1 |
#define | PAGE_RIGHT 2 |
#define | PAGE_SAME_REC 3 |
#define | PAGE_SAME_PAGE 4 |
#define | PAGE_NO_DIRECTION 5 |
#define | PAGE_DIR FIL_PAGE_DATA_END |
#define | PAGE_DIR_SLOT_SIZE 2 |
#define | PAGE_EMPTY_DIR_START (PAGE_DIR + 2 * PAGE_DIR_SLOT_SIZE) |
#define | PAGE_DIR_SLOT_MAX_N_OWNED 8 |
#define | PAGE_DIR_SLOT_MIN_N_OWNED 4 |
#define | page_header_get_ptr(page, field) |
#define | page_get_infimum_rec(page) ((page) + page_get_infimum_offset(page)) |
#define | page_get_supremum_rec(page) ((page) + page_get_supremum_offset(page)) |
#define | page_dir_get_nth_slot(page, n) |
Typedefs | |
typedef byte | page_header_t |
typedef byte | page_dir_slot_t |
typedef page_dir_slot_t | page_dir_t |
Functions | |
UNIV_INLINE page_t * | page_align (const void *ptr) __attribute__((const )) |
UNIV_INLINE ulint | page_offset (const void *ptr) __attribute__((const )) |
UNIV_INLINE trx_id_t | page_get_max_trx_id (const page_t *page) |
UNIV_INTERN void | page_set_max_trx_id (buf_block_t *block, page_zip_des_t *page_zip, trx_id_t trx_id, mtr_t *mtr) |
UNIV_INLINE void | page_update_max_trx_id (buf_block_t *block, page_zip_des_t *page_zip, trx_id_t trx_id, mtr_t *mtr) |
UNIV_INLINE ulint | page_header_get_field (const page_t *page, ulint field) |
UNIV_INLINE void | page_header_set_field (page_t *page, page_zip_des_t *page_zip, ulint field, ulint val) |
UNIV_INLINE ulint | page_header_get_offs (const page_t *page, ulint field) __attribute__((nonnull |
UNIV_INLINE void | page_header_set_ptr (page_t *page, page_zip_des_t *page_zip, ulint field, const byte *ptr) |
UNIV_INLINE void | page_header_reset_last_insert (page_t *page, page_zip_des_t *page_zip, mtr_t *mtr) |
UNIV_INLINE ulint | page_get_infimum_offset (const page_t *page) |
UNIV_INLINE ulint | page_get_supremum_offset (const page_t *page) |
UNIV_INTERN rec_t * | page_get_middle_rec (page_t *page) |
UNIV_INLINE int | page_cmp_dtuple_rec_with_match (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets, ulint *matched_fields, ulint *matched_bytes) |
UNIV_INLINE ulint | page_get_page_no (const page_t *page) |
UNIV_INLINE ulint | page_get_space_id (const page_t *page) |
UNIV_INLINE ulint | page_get_n_recs (const page_t *page) |
UNIV_INTERN ulint | page_rec_get_n_recs_before (const rec_t *rec) |
UNIV_INLINE ulint | page_dir_get_n_heap (const page_t *page) |
UNIV_INLINE void | page_dir_set_n_heap (page_t *page, page_zip_des_t *page_zip, ulint n_heap) |
UNIV_INLINE ulint | page_dir_get_n_slots (const page_t *page) |
UNIV_INLINE void | page_dir_set_n_slots (page_t *page, page_zip_des_t *page_zip, ulint n_slots) |
UNIV_INLINE ibool | page_rec_check (const rec_t *rec) |
UNIV_INLINE const rec_t * | page_dir_slot_get_rec (const page_dir_slot_t *slot) |
UNIV_INLINE void | page_dir_slot_set_rec (page_dir_slot_t *slot, rec_t *rec) |
UNIV_INLINE ulint | page_dir_slot_get_n_owned (const page_dir_slot_t *slot) |
UNIV_INLINE void | page_dir_slot_set_n_owned (page_dir_slot_t *slot, page_zip_des_t *page_zip, ulint n) |
UNIV_INLINE ulint | page_dir_calc_reserved_space (ulint n_recs) |
UNIV_INTERN ulint | page_dir_find_owner_slot (const rec_t *rec) |
UNIV_INLINE ulint | page_is_comp (const page_t *page) |
UNIV_INLINE ulint | page_rec_is_comp (const rec_t *rec) |
UNIV_INLINE ulint | page_rec_get_heap_no (const rec_t *rec) |
UNIV_INLINE ibool | page_is_leaf (const page_t *page) __attribute__((nonnull |
UNIV_INLINE const rec_t * | page_rec_get_next_low (const rec_t *rec, ulint comp) |
UNIV_INLINE rec_t * | page_rec_get_next (rec_t *rec) |
UNIV_INLINE const rec_t * | page_rec_get_next_const (const rec_t *rec) |
UNIV_INLINE void | page_rec_set_next (rec_t *rec, rec_t *next) |
UNIV_INLINE const rec_t * | page_rec_get_prev_const (const rec_t *rec) |
UNIV_INLINE rec_t * | page_rec_get_prev (rec_t *rec) |
UNIV_INLINE ibool | page_rec_is_user_rec_low (ulint offset) __attribute__((const )) |
UNIV_INLINE ibool | page_rec_is_supremum_low (ulint offset) __attribute__((const )) |
UNIV_INLINE ibool | page_rec_is_infimum_low (ulint offset) __attribute__((const )) |
UNIV_INLINE ibool | page_rec_is_user_rec (const rec_t *rec) __attribute__((const )) |
UNIV_INLINE ibool | page_rec_is_supremum (const rec_t *rec) __attribute__((const )) |
UNIV_INLINE ibool | page_rec_is_infimum (const rec_t *rec) __attribute__((const )) |
UNIV_INLINE rec_t * | page_rec_find_owner_rec (rec_t *rec) |
UNIV_INTERN void | page_rec_write_index_page_no (rec_t *rec, ulint i, ulint page_no, mtr_t *mtr) |
UNIV_INLINE ulint | page_get_max_insert_size (const page_t *page, ulint n_recs) |
UNIV_INLINE ulint | page_get_max_insert_size_after_reorganize (const page_t *page, ulint n_recs) |
UNIV_INLINE ulint | page_get_free_space_of_empty (ulint comp) __attribute__((const )) |
UNIV_INLINE ulint | page_rec_get_base_extra_size (const rec_t *rec) |
UNIV_INLINE ulint | page_get_data_size (const page_t *page) |
UNIV_INLINE void | page_mem_alloc_free (page_t *page, page_zip_des_t *page_zip, rec_t *next_rec, ulint need) |
UNIV_INTERN byte * | page_mem_alloc_heap (page_t *page, page_zip_des_t *page_zip, ulint need, ulint *heap_no) |
UNIV_INLINE void | page_mem_free (page_t *page, page_zip_des_t *page_zip, rec_t *rec, dict_index_t *index, const ulint *offsets) |
UNIV_INTERN page_t * | page_create (buf_block_t *block, mtr_t *mtr, ulint comp) |
UNIV_INTERN page_t * | page_create_zip (buf_block_t *block, dict_index_t *index, ulint level, mtr_t *mtr) |
UNIV_INTERN void | page_copy_rec_list_end_no_locks (buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr) |
UNIV_INTERN rec_t * | page_copy_rec_list_end (buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INTERN rec_t * | page_copy_rec_list_start (buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INTERN void | page_delete_rec_list_end (rec_t *rec, buf_block_t *block, dict_index_t *index, ulint n_recs, ulint size, mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INTERN void | page_delete_rec_list_start (rec_t *rec, buf_block_t *block, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INTERN ibool | page_move_rec_list_end (buf_block_t *new_block, buf_block_t *block, rec_t *split_rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1 |
UNIV_INTERN ibool UNIV_INTERN ibool | page_move_rec_list_start (buf_block_t *new_block, buf_block_t *block, rec_t *split_rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1 |
UNIV_INTERN ibool UNIV_INTERN ibool UNIV_INTERN void | page_dir_split_slot (page_t *page, page_zip_des_t *page_zip, ulint slot_no) __attribute__((nonnull(1))) |
UNIV_INTERN void | page_dir_balance_slot (page_t *page, page_zip_des_t *page_zip, ulint slot_no) __attribute__((nonnull(1))) |
UNIV_INTERN byte * | page_parse_delete_rec_list (byte type, byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr) |
UNIV_INTERN byte * | page_parse_create (byte *ptr, byte *end_ptr, ulint comp, buf_block_t *block, mtr_t *mtr) |
UNIV_INTERN void | page_rec_print (const rec_t *rec, const ulint *offsets) |
UNIV_INTERN void | page_dir_print (page_t *page, ulint pr_n) |
UNIV_INTERN void | page_print_list (buf_block_t *block, dict_index_t *index, ulint pr_n) |
UNIV_INTERN void | page_header_print (const page_t *page) |
UNIV_INTERN void | page_print (buf_block_t *block, dict_index_t *index, ulint dn, ulint rn) |
UNIV_INTERN ibool | page_rec_validate (rec_t *rec, const ulint *offsets) |
UNIV_INTERN void | page_check_dir (const page_t *page) |
UNIV_INTERN ibool | page_simple_validate_old (page_t *page) |
UNIV_INTERN ibool | page_simple_validate_new (page_t *block) |
UNIV_INTERN ibool | page_validate (page_t *page, dict_index_t *index) |
const rec_t * | page_find_rec_with_heap_no (const page_t *page, ulint heap_no) |
Variables | |
UNIV_INLINE ulint | pure |
#define PAGE_BTR_SEG_LEAF |
Definition at line 69 of file page0page.h.
#define page_dir_get_nth_slot | ( | page, | |
n | |||
) |
Definition at line 387 of file page0page.h.
#define PAGE_HEADER |
Definition at line 53 of file page0page.h.
#define page_header_get_ptr | ( | page, | |
field | |||
) |
Returns the pointer stored in the given header field, or NULL.
Definition at line 222 of file page0page.h.
Referenced by btr_page_get_split_rec_to_left(), btr_page_get_split_rec_to_right(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_cur_search_with_match(), page_delete_rec_list_end(), page_mem_alloc_heap(), page_simple_validate_new(), page_simple_validate_old(), and page_validate().
#define PAGE_HEADER_PRIV_END |
Definition at line 65 of file page0page.h.
#define PAGE_HEAP_NO_USER_LOW |
Definition at line 109 of file page0page.h.
#define PAGE_INDEX_ID |
Definition at line 68 of file page0page.h.
#define PAGE_LAST_INSERT |
Definition at line 60 of file page0page.h.
#define PAGE_LEVEL |
Definition at line 67 of file page0page.h.
#define PAGE_MAX_TRX_ID |
Definition at line 64 of file page0page.h.
#define PAGE_N_DIRECTION |
Definition at line 62 of file page0page.h.
#define PAGE_N_HEAP |
Definition at line 57 of file page0page.h.
UNIV_INLINE page_t* page_align | ( | const void * | ptr | ) | const |
Gets the start of a page.
ptr | in: pointer to page frame |
Referenced by btr_free_externally_stored_field(), btr_get_next_user_rec(), btr_get_prev_user_rec(), btr_index_rec_validate(), btr_pcur_store_position(), btr_store_big_rec_extern_fields(), flst_add_first(), flst_add_last(), flst_cut_end(), flst_print(), flst_remove(), ha_insert_for_fold_func(), ha_remove_all_nodes_to_page(), ha_search_and_update_if_found_func(), lock_clust_rec_modify_check_and_lock(), lock_clust_rec_read_check_and_lock(), lock_move_rec_list_start(), lock_rec_insert_check_and_lock(), lock_rec_store_on_page_infimum(), lock_rec_unlock(), lock_sec_rec_cons_read_sees(), lock_sec_rec_modify_check_and_lock(), lock_sec_rec_read_check_and_lock(), lock_update_delete(), lock_update_insert(), lock_update_merge_left(), page_copy_rec_list_end(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_copy_rec_list_start(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_delete_rec_list_end(), page_dir_find_owner_slot(), page_rec_get_n_recs_before(), page_rec_validate(), page_zip_rec_set_deleted(), page_zip_write_rec(), page_zip_write_trx_id_and_roll_ptr(), row_search_for_mysql(), trx_undo_get_next_rec(), and trx_undo_truncate_start().
UNIV_INTERN void page_check_dir | ( | const page_t * | page | ) |
Checks that the first directory slot points to the infimum record and the last to the supremum. This function is intended to track if the bug fixed in 4.0.14 has caused corruption to users' databases. in: index page
Checks that the first directory slot points to the infimum record and the last to the supremum. This function is intended to track if the bug fixed in 4.0.14 has caused corruption to users' databases.
page | in: index page |
Definition at line 1839 of file page0page.cc.
References mach_read_from_2(), page_check_dir(), page_dir_get_n_slots(), page_rec_is_infimum_low(), and page_rec_is_supremum_low().
Referenced by btr_pcur_move_to_next_page(), page_check_dir(), and page_cur_search_with_match().
UNIV_INLINE int page_cmp_dtuple_rec_with_match | ( | const dtuple_t * | dtuple, |
const rec_t * | rec, | ||
const ulint * | offsets, | ||
ulint * | matched_fields, | ||
ulint * | matched_bytes | ||
) |
Compares a data tuple to a physical record. Differs from the function cmp_dtuple_rec_with_match in the way that the record must reside on an index page, and also page infimum and supremum records can be given in the parameter rec. These are considered as the negative infinity and the positive infinity in the alphabetical order.
dtuple | in: data tuple |
rec | in: physical record on a page; may also be page infimum or supremum, in which case matched-parameter values below are not affected |
offsets | in: array returned by rec_get_offsets() |
matched_fields | in/out: number of already completely matched fields; when function returns contains the value for current comparison |
Referenced by page_cur_search_with_match().
UNIV_INTERN rec_t* page_copy_rec_list_end | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
rec_t * | rec, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Copies records from page to new_page, from the given record onward, including that record. Infimum and supremum records are not copied. The records are copied to the start of the record list on new_page.
Copies records from page to new_page, from a given record onward, including that record. Infimum and supremum records are not copied. The records are copied to the start of the record list on new_page.
new_block | in/out: index page to copy to |
block | in: index page containing rec |
rec | in: record on page |
index | in: record descriptor |
mtr | in: mtr |
Definition at line 614 of file page0page.cc.
References buf_block_get_page_zip, dict_index_is_sec_or_ibuf(), lock_move_rec_list_end(), mtr_set_log_mode(), page_align(), page_copy_rec_list_end(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_dir_get_n_heap(), page_get_max_trx_id(), page_is_comp(), page_is_leaf(), page_rec_get_n_recs_before(), page_rec_get_next(), page_update_max_trx_id(), page_validate(), page_zip_compress(), page_zip_decompress(), page_zip_reorganize(), rec_get_next_ptr(), ut_a, ut_ad, and ut_error.
Referenced by btr_compress(), btr_root_raise_and_insert(), and page_copy_rec_list_end().
UNIV_INTERN void page_copy_rec_list_end_no_locks | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
rec_t * | rec, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Differs from page_copy_rec_list_end, because this function does not touch the lock table and max trx id on page or compress the page. in: mtr
Differs from page_copy_rec_list_end, because this function does not touch the lock table and max trx id on page or compress the page.
new_block | in: index page to copy to |
block | in: index page of rec |
rec | in: record on page |
index | in: record descriptor |
mtr | in: mtr |
Definition at line 539 of file page0page.cc.
References dict_table_is_comp(), mach_read_from_2(), mem_heap_free, page_align(), page_copy_rec_list_end_no_locks(), page_cur_insert_rec_low(), page_cur_is_after_last(), page_cur_is_before_first(), page_cur_move_to_next(), page_cur_position(), page_is_comp(), page_offset(), page_rec_is_comp(), dict_index_struct::table, ut_a, ut_error, and ut_print_timestamp().
Referenced by page_copy_rec_list_end(), page_copy_rec_list_end_no_locks(), and page_zip_reorganize().
UNIV_INTERN rec_t* page_copy_rec_list_start | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
rec_t * | rec, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Copies records from page to new_page, up to the given record, NOT including that record. Infimum and supremum records are not copied. The records are copied to the end of the record list on new_page.
new_block | in/out: index page to copy to |
block | in: index page containing rec |
rec | in: record on page |
index | in: record descriptor |
mtr | in: mtr |
Definition at line 722 of file page0page.cc.
References buf_block_get_page_zip, dict_index_is_sec_or_ibuf(), lock_move_rec_list_start(), mem_heap_free, mtr_set_log_mode(), page_align(), page_copy_rec_list_start(), page_cur_insert_rec_low(), page_cur_move_to_next(), page_cur_set_before_first(), page_get_max_trx_id(), page_is_leaf(), page_rec_get_n_recs_before(), page_rec_get_prev(), page_rec_is_infimum(), page_update_max_trx_id(), page_validate(), page_zip_compress(), page_zip_decompress(), page_zip_reorganize(), rec_get_next_ptr(), ut_a, ut_ad, and ut_error.
Referenced by btr_compress(), and page_copy_rec_list_start().
UNIV_INTERN page_t* page_create | ( | buf_block_t * | block, |
mtr_t * | mtr, | ||
ulint | comp | ||
) |
Create an uncompressed B-tree index page.
Create an uncompressed B-tree index page.
block | in: a buffer block where the page is created |
mtr | in: mini-transaction handle |
comp | in: nonzero=compact page format |
Definition at line 490 of file page0page.cc.
References page_create().
Referenced by btr_create(), page_create(), page_parse_create(), and page_zip_reorganize().
UNIV_INTERN page_t* page_create_zip | ( | buf_block_t * | block, |
dict_index_t * | index, | ||
ulint | level, | ||
mtr_t * | mtr | ||
) |
Create a compressed B-tree index page.
Create a compressed B-tree index page.
block | in/out: a buffer frame where the page is created |
index | in: the index of the page |
level | in: the B-tree level of the page |
mtr | in: mini-transaction handle |
Definition at line 506 of file page0page.cc.
References buf_block_get_page_zip, dict_table_is_comp(), mach_write_to_2(), page_create_zip(), page_zip_compress(), dict_index_struct::table, ut_ad, and ut_error.
Referenced by btr_create(), and page_create_zip().
UNIV_INTERN void page_delete_rec_list_end | ( | rec_t * | rec, |
buf_block_t * | block, | ||
dict_index_t * | index, | ||
ulint | n_recs, | ||
ulint | size, | ||
mtr_t * | mtr | ||
) |
Deletes records from a page from a given record onward, including that record. The infimum and supremum records are not deleted.
rec | in: pointer to record on page |
block | in: buffer block of the page |
index | in: record descriptor |
n_recs | in: number of records to delete, or ULINT_UNDEFINED if not known |
size | in: the sum of the sizes of the records in the end of the chain to delete, or ULINT_UNDEFINED if not known |
mtr | in: mtr |
Definition at line 922 of file page0page.cc.
References buf_block_get_page_zip, buf_block_modify_clock_inc(), mem_heap_free, MLOG_COMP_LIST_END_DELETE, MLOG_LIST_END_DELETE, mtr_set_log_mode(), page_align(), page_cur_delete_rec(), page_cur_position(), page_delete_rec_list_end(), page_dir_find_owner_slot(), page_dir_set_n_slots(), page_dir_slot_set_n_owned(), page_dir_slot_set_rec(), page_get_n_recs(), page_header_get_field(), page_header_get_ptr, page_header_set_field(), page_header_set_ptr(), page_is_comp(), page_offset(), page_rec_get_next(), page_rec_get_prev(), page_rec_is_comp(), page_rec_is_infimum(), page_rec_is_supremum(), page_rec_set_next(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_get_next_ptr(), rec_offs_extra_size(), rec_offs_size(), ut_a, and ut_ad.
Referenced by btr_page_split_and_insert(), page_delete_rec_list_end(), and page_parse_delete_rec_list().
UNIV_INTERN void page_delete_rec_list_start | ( | rec_t * | rec, |
buf_block_t * | block, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Deletes records from page, up to the given record, NOT including that record. Infimum and supremum records are not deleted.
rec | in: record on page |
block | in: buffer block of the page |
index | in: record descriptor |
mtr | in: mtr |
Definition at line 1098 of file page0page.cc.
References buf_block_get_page_zip, dict_table_is_comp(), mem_heap_free, MLOG_COMP_LIST_START_DELETE, MLOG_LIST_START_DELETE, mtr_set_log_mode(), page_cur_delete_rec(), page_cur_move_to_next(), page_cur_set_before_first(), page_delete_rec_list_start(), page_rec_is_comp(), page_rec_is_infimum(), dict_index_struct::table, ut_a, and ut_ad.
Referenced by btr_page_split_and_insert(), page_delete_rec_list_start(), and page_parse_delete_rec_list().
UNIV_INTERN void page_dir_balance_slot | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | slot_no | ||
) |
Tries to balance the given directory slot with too few records with the upper neighbor, so that there are at least the minimum number of records owned by the slot; this may result in the merging of two slots.
page | in/out: index page |
page_zip | in/out: compressed page, or NULL |
slot_no | in: the directory slot |
Definition at line 1412 of file page0page.cc.
References page_dir_balance_slot(), page_dir_get_n_slots(), page_dir_slot_get_n_owned(), page_dir_slot_get_rec(), page_dir_slot_set_n_owned(), page_dir_slot_set_rec(), page_is_comp(), rec_get_next_ptr(), rec_set_n_owned_new(), rec_set_n_owned_old(), and ut_ad.
Referenced by page_cur_delete_rec(), and page_dir_balance_slot().
UNIV_INLINE ulint page_dir_calc_reserved_space | ( | ulint | n_recs | ) |
Calculates the space reserved for directory slots of a given number of records. The exact value is a fraction number n * PAGE_DIR_SLOT_SIZE / PAGE_DIR_SLOT_MIN_N_OWNED, and it is rounded upwards to an integer. in: number of records
UNIV_INTERN ulint page_dir_find_owner_slot | ( | const rec_t * | rec | ) |
Looks for the directory slot which owns the given record.
Looks for the directory slot which owns the given record.
rec | in: the physical record |
Definition at line 89 of file page0page.cc.
References mach_decode_2(), mach_encode_2(), page_align(), page_dir_find_owner_slot(), page_dir_get_n_slots(), page_get_page_no(), page_is_comp(), page_rec_check(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_get_next_ptr_const(), rec_print_old(), ut_ad, and ut_error.
Referenced by page_cur_delete_rec(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_delete_rec_list_end(), and page_dir_find_owner_slot().
UNIV_INLINE ulint page_dir_get_n_heap | ( | const page_t * | page | ) |
Gets the number of records in the heap.
Referenced by page_copy_rec_list_end(), page_copy_rec_list_end_to_created_page(), page_header_print(), page_mem_alloc_heap(), page_rec_validate(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), page_zip_dir_add_slot(), page_zip_dir_insert(), page_zip_parse_write_node_ptr(), page_zip_write_rec(), and page_zip_write_trx_id_and_roll_ptr().
UNIV_INLINE ulint page_dir_get_n_slots | ( | const page_t * | page | ) |
Gets the number of dir slots in directory.
Referenced by page_check_dir(), page_cur_search_with_match(), page_dir_balance_slot(), page_dir_find_owner_slot(), page_dir_print(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), and page_zip_write_rec().
UNIV_INTERN void page_dir_print | ( | page_t * | page, |
ulint | pr_n | ||
) |
This is used to print the contents of the directory for debugging purposes. in: print n first and n last entries
This is used to print the contents of the directory for debugging purposes.
page | in: index page |
pr_n | in: print n first and n last entries |
Definition at line 1627 of file page0page.cc.
References page_dir_get_n_slots(), page_dir_print(), page_dir_slot_get_n_owned(), page_dir_slot_get_rec(), page_get_n_recs(), and page_offset().
Referenced by page_dir_print(), and page_print().
UNIV_INLINE void page_dir_set_n_heap | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | n_heap | ||
) |
Sets the number of records in the heap. in: number of records
page | in/out: index page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL. Note that the size of the dense page directory in the compressed page trailer is n_heap * PAGE_ZIP_DIR_SLOT_SIZE. |
Referenced by page_copy_rec_list_end_to_created_page(), and page_mem_alloc_heap().
UNIV_INLINE void page_dir_set_n_slots | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | n_slots | ||
) |
Sets the number of dir slots in directory. in: number of slots
page | in/out: page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL |
Referenced by page_copy_rec_list_end_to_created_page(), and page_delete_rec_list_end().
UNIV_INLINE ulint page_dir_slot_get_n_owned | ( | const page_dir_slot_t * | slot | ) |
Gets the number of records owned by a directory slot.
Referenced by page_cur_delete_rec(), page_dir_balance_slot(), page_dir_print(), page_dir_split_slot(), and page_get_middle_rec().
UNIV_INLINE const rec_t* page_dir_slot_get_rec | ( | const page_dir_slot_t * | slot | ) |
Gets the record pointed to by a directory slot.
Referenced by page_cur_delete_rec(), page_cur_search_with_match(), page_dir_balance_slot(), page_dir_print(), page_dir_split_slot(), page_get_middle_rec(), page_rec_get_n_recs_before(), page_simple_validate_new(), page_simple_validate_old(), and page_validate().
UNIV_INLINE void page_dir_slot_set_n_owned | ( | page_dir_slot_t * | slot, |
page_zip_des_t * | page_zip, | ||
ulint | n | ||
) |
This is used to set the owned records field of a directory slot. in: number of records owned by the slot
slot | in/out: directory slot |
page_zip | in/out: compressed page, or NULL |
Referenced by page_copy_rec_list_end_to_created_page(), page_cur_delete_rec(), page_delete_rec_list_end(), page_dir_balance_slot(), and page_dir_split_slot().
UNIV_INLINE void page_dir_slot_set_rec | ( | page_dir_slot_t * | slot, |
rec_t * | rec | ||
) |
This is used to set the record offset in a directory slot. in: record on the page
slot | in: directory slot |
Referenced by page_copy_rec_list_end_to_created_page(), page_cur_delete_rec(), page_delete_rec_list_end(), page_dir_balance_slot(), and page_dir_split_slot().
UNIV_INTERN ibool UNIV_INTERN ibool UNIV_INTERN void page_dir_split_slot | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | slot_no | ||
) |
Splits a directory slot which owns too many records.
page | in/out: index page |
page_zip | in/out: compressed page whose uncompressed part will be written, or NULL |
slot_no | in: the directory slot |
Definition at line 1349 of file page0page.cc.
References page_dir_slot_get_n_owned(), page_dir_slot_get_rec(), page_dir_slot_set_n_owned(), page_dir_slot_set_rec(), page_dir_split_slot(), page_is_comp(), page_rec_get_next(), and ut_ad.
Referenced by page_cur_insert_rec_low(), page_cur_insert_rec_zip(), and page_dir_split_slot().
const rec_t* page_find_rec_with_heap_no | ( | const page_t * | page, |
ulint | heap_no | ||
) |
Looks in the page record list for a record with the given heap number.
Looks in the page record list for a record with the given heap number.
page | in: index page |
heap_no | in: heap number |
Definition at line 2583 of file page0page.cc.
References page_find_rec_with_heap_no(), page_is_comp(), rec_get_heap_no_new(), rec_get_heap_no_old(), and rec_get_next_offs().
Referenced by lock_rec_print(), and page_find_rec_with_heap_no().
UNIV_INLINE ulint page_get_data_size | ( | const page_t * | page | ) |
Returns the sum of the sizes of the records in the record list excluding the infimum and supremum records.
Referenced by btr_compress(), btr_cur_optimistic_update(), and page_validate().
UNIV_INLINE ulint page_get_free_space_of_empty | ( | ulint | comp | ) | const |
Calculates free space if a page is emptied.
comp | in: nonzero=compact page format |
Referenced by btr_cur_optimistic_update(), convert_error_code_to_mysql(), and ibuf_insert().
UNIV_INLINE ulint page_get_infimum_offset | ( | const page_t * | page | ) |
Gets the offset of the first record on the page.
UNIV_INLINE ulint page_get_max_insert_size | ( | const page_t * | page, |
ulint | n_recs | ||
) |
Returns the maximum combined size of records which can be inserted on top of record heap.
page | in: index page |
Referenced by btr_compress(), btr_create(), btr_cur_optimistic_insert(), and page_mem_alloc_heap().
UNIV_INLINE ulint page_get_max_insert_size_after_reorganize | ( | const page_t * | page, |
ulint | n_recs | ||
) |
Returns the maximum combined size of records which can be inserted on top of record heap if page is first reorganized.
page | in: index page |
Referenced by btr_compress(), btr_cur_optimistic_delete(), btr_cur_optimistic_insert(), and btr_cur_optimistic_update().
Returns the max trx id field value. in: page
Referenced by lock_sec_rec_cons_read_sees(), lock_sec_rec_read_check_and_lock(), page_copy_rec_list_end(), page_copy_rec_list_start(), and page_zip_reorganize().
UNIV_INTERN rec_t* page_get_middle_rec | ( | page_t * | page | ) |
Returns the middle record of record list. If there are an even number of records in the list, returns the first record of upper half-list.
Returns the middle record of the record list. If there are an even number of records in the list, returns the first record of the upper half-list.
page | in: page |
Definition at line 1484 of file page0page.cc.
References page_dir_slot_get_n_owned(), page_dir_slot_get_rec(), page_get_middle_rec(), page_get_n_recs(), page_rec_get_next(), and ut_ad.
Referenced by btr_page_split_and_insert(), and page_get_middle_rec().
UNIV_INLINE ulint page_get_n_recs | ( | const page_t * | page | ) |
Gets the number of user records on page (the infimum and supremum records are not user records).
Referenced by btr_compress(), btr_cur_optimistic_insert(), btr_cur_optimistic_update(), btr_cur_pessimistic_delete(), btr_page_split_and_insert(), btr_pcur_store_position(), btr_search_drop_page_hash_index(), ibuf_init_at_db_start(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_cur_open_on_rnd_user_rec(), page_delete_rec_list_end(), page_dir_print(), page_get_middle_rec(), page_print_list(), and row_search_max_autoinc().
UNIV_INLINE ulint page_get_page_no | ( | const page_t * | page | ) |
Gets the page number.
Referenced by btr_free_externally_stored_field(), btr_get_next_user_rec(), btr_get_prev_user_rec(), btr_root_raise_and_insert(), flst_print(), page_dir_find_owner_slot(), page_validate(), row_search_for_mysql(), and trx_undo_truncate_start().
UNIV_INLINE ulint page_get_space_id | ( | const page_t * | page | ) |
Gets the tablespace identifier.
Referenced by btr_free_externally_stored_field(), btr_get_next_user_rec(), btr_get_prev_user_rec(), flst_print(), page_validate(), and trx_undo_get_next_rec().
UNIV_INLINE ulint page_get_supremum_offset | ( | const page_t * | page | ) |
Gets the offset of the last record on the page.
UNIV_INLINE ulint page_header_get_field | ( | const page_t * | page, |
ulint | field | ||
) |
Reads the given header field. in: PAGE_N_DIR_SLOTS, ...
page | in: page |
Referenced by page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_cur_search_with_match(), page_delete_rec_list_end(), page_header_print(), page_simple_validate_new(), page_simple_validate_old(), and page_validate().
UNIV_INLINE ulint page_header_get_offs | ( | const page_t * | page, |
ulint | field | ||
) |
Returns the offset stored in the given header field.
page | in: page |
field | in: PAGE_FREE, ... |
UNIV_INTERN void page_header_print | ( | const page_t * | page | ) |
Prints the info in a page header. in: index page
Prints the info in a page header.
Definition at line 1739 of file page0page.cc.
References page_dir_get_n_heap(), page_header_get_field(), page_header_print(), and page_is_comp().
Referenced by page_header_print(), and page_print().
UNIV_INLINE void page_header_reset_last_insert | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
mtr_t * | mtr | ||
) |
Resets the last insert info field in the page header. Writes to mlog about this operation. in: mtr
page | in: page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL |
UNIV_INLINE void page_header_set_field | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | field, | ||
ulint | val | ||
) |
Sets the given header field. in: value
page | in/out: page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL |
field | in: PAGE_N_DIR_SLOTS, ... |
Referenced by page_copy_rec_list_end_to_created_page(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_delete_rec_list_end(), and page_parse_copy_rec_list_to_created_page().
UNIV_INLINE void page_header_set_ptr | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | field, | ||
const byte * | ptr | ||
) |
Sets the pointer stored in the given header field. in: pointer or NULL
page | in/out: page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL |
field | in/out: PAGE_FREE, ... |
Referenced by page_copy_rec_list_end_to_created_page(), page_cur_delete_rec(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_delete_rec_list_end(), page_mem_alloc_heap(), and page_parse_copy_rec_list_to_created_page().
UNIV_INLINE ulint page_is_comp | ( | const page_t * | page | ) |
Determine whether the page is in new-style compact format.
Referenced by btr_compress(), btr_cur_optimistic_insert(), btr_cur_optimistic_update(), btr_cur_parse_del_mark_set_clust_rec(), btr_cur_parse_update_in_place(), btr_cur_pessimistic_update(), btr_cur_search_to_nth_level(), btr_cur_update_in_place(), btr_discard_page(), btr_get_next_user_rec(), btr_get_prev_user_rec(), btr_index_rec_validate(), btr_parse_set_min_rec_mark(), btr_pcur_move_to_next_page(), btr_search_drop_page_hash_index(), lock_move_reorganize_page(), lock_update_delete(), lock_update_discard(), page_copy_rec_list_end(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_cur_delete_rec(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_cur_parse_delete_rec(), page_cur_parse_insert_rec(), page_delete_rec_list_end(), page_dir_balance_slot(), page_dir_find_owner_slot(), page_dir_split_slot(), page_find_rec_with_heap_no(), page_header_print(), page_parse_delete_rec_list(), page_print_list(), page_rec_get_n_recs_before(), page_rec_validate(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), page_zip_dir_add_slot(), and page_zip_reorganize().
UNIV_INLINE ibool page_is_leaf | ( | const page_t * | page | ) |
Determine whether the page is a B-tree leaf.
page | in: page |
Referenced by btr_compress(), btr_cur_optimistic_delete(), btr_cur_optimistic_insert(), btr_cur_optimistic_update(), btr_cur_pessimistic_update(), btr_cur_update_alloc_zip(), btr_cur_update_in_place(), btr_discard_page(), btr_page_split_and_insert(), ibuf_update_free_bits_zip(), page_copy_rec_list_end(), page_copy_rec_list_start(), page_cur_insert_rec_zip(), page_cur_search_with_match(), page_validate(), page_zip_dir_add_slot(), page_zip_parse_write_blob_ptr(), page_zip_parse_write_node_ptr(), page_zip_reorganize(), page_zip_write_rec(), and page_zip_write_trx_id_and_roll_ptr().
UNIV_INLINE void page_mem_alloc_free | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
rec_t * | next_rec, | ||
ulint | need | ||
) |
Allocates a block of memory from the head of the free list of an index page. in: number of bytes allocated
page | in/out: index page |
page_zip | in/out: compressed page with enough space available for inserting the record, or NULL |
next_rec | in: pointer to the new head of the free record list |
Referenced by page_cur_insert_rec_low(), and page_cur_insert_rec_zip().
UNIV_INTERN byte* page_mem_alloc_heap | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
ulint | need, | ||
ulint * | heap_no | ||
) |
Allocates a block of memory from the heap of an index page.
Allocates a block of memory from the heap of an index page.
page | in/out: index page |
page_zip | in/out: compressed page with enough space available for inserting the record, or NULL |
need | in: total number of bytes needed |
heap_no | out: this contains the heap number of the allocated record if allocation succeeds |
Definition at line 255 of file page0page.cc.
References page_dir_get_n_heap(), page_dir_set_n_heap(), page_get_max_insert_size(), page_header_get_ptr, page_header_set_ptr(), page_mem_alloc_heap(), and ut_ad.
Referenced by page_cur_insert_rec_low(), page_cur_insert_rec_zip(), and page_mem_alloc_heap().
UNIV_INLINE void page_mem_free | ( | page_t * | page, |
page_zip_des_t * | page_zip, | ||
rec_t * | rec, | ||
dict_index_t * | index, | ||
const ulint * | offsets | ||
) |
Puts a record to free list. in: array returned by rec_get_offsets()
page | in/out: index page |
page_zip | in/out: compressed page, or NULL |
rec | in: pointer to the (origin of) record |
index | in: index of rec |
Referenced by page_cur_delete_rec().
UNIV_INTERN ibool page_move_rec_list_end | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
rec_t * | split_rec, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Moves record list end to another page. Moved records include split_rec.
new_block | in/out: index page where to move |
block | in: index page from where to move |
split_rec | in: first record to move |
index | in: record descriptor |
mtr | in: mtr |
Referenced by btr_page_split_and_insert().
UNIV_INTERN ibool UNIV_INTERN ibool page_move_rec_list_start | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
rec_t * | split_rec, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Moves record list start to another page. Moved records do not include split_rec.
new_block | in/out: index page where to move |
block | in/out: page containing split_rec |
split_rec | in: first record not to move |
index | in: record descriptor |
mtr | in: mtr |
Referenced by btr_page_split_and_insert().
UNIV_INLINE ulint page_offset | ( | const void * | ptr | ) | const |
Gets the offset within a page.
ptr | in: pointer to page frame |
Referenced by btr_pcur_store_position(), flst_print(), mlog_log_string(), mlog_write_ulint(), mlog_write_ull(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_cur_parse_insert_rec(), page_delete_rec_list_end(), page_dir_print(), page_rec_validate(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), page_zip_dir_insert(), page_zip_rec_set_deleted(), page_zip_rec_set_owned(), page_zip_write_rec(), and row_search_for_mysql().
UNIV_INTERN byte* page_parse_create | ( | byte * | ptr, |
byte * | , | ||
ulint | comp, | ||
buf_block_t * | block, | ||
mtr_t * | mtr | ||
) |
Parses a redo log record of creating a page.
Parses a redo log record of creating a page.
ptr | in: buffer |
comp | in: nonzero=compact page format |
block | in: block or NULL |
mtr | in: mtr or NULL |
Definition at line 313 of file page0page.cc.
References page_create(), page_parse_create(), and ut_ad.
Referenced by page_parse_create().
UNIV_INTERN byte* page_parse_delete_rec_list | ( | byte | type, |
byte * | ptr, | ||
byte * | end_ptr, | ||
buf_block_t * | block, | ||
dict_index_t * | index, | ||
mtr_t * | mtr | ||
) |
Parses a log record of a record list end or start deletion.
Parses a log record of a record list end or start deletion.
type | in: MLOG_LIST_END_DELETE, MLOG_LIST_START_DELETE, MLOG_COMP_LIST_END_DELETE or MLOG_COMP_LIST_START_DELETE |
ptr | in: buffer |
end_ptr | in: buffer end |
block | in/out: buffer block or NULL |
index | in: record descriptor |
mtr | in: mtr or NULL |
Definition at line 866 of file page0page.cc.
References dict_table_is_comp(), mach_read_from_2(), MLOG_COMP_LIST_END_DELETE, MLOG_COMP_LIST_START_DELETE, MLOG_LIST_END_DELETE, MLOG_LIST_START_DELETE, page_delete_rec_list_end(), page_delete_rec_list_start(), page_is_comp(), page_parse_delete_rec_list(), dict_index_struct::table, and ut_ad.
Referenced by page_parse_delete_rec_list().
UNIV_INTERN void page_print | ( | buf_block_t * | block, |
dict_index_t * | index, | ||
ulint | dn, | ||
ulint | rn | ||
) |
This is used to print the contents of the page for debugging purposes. in: print rn first and last records in directory
This is used to print the contents of the page for debugging purposes.
block | in: index page |
index | in: dictionary index of the page |
dn | in: print dn first and last entries in directory |
rn | in: print rn first and last records in directory |
Definition at line 1767 of file page0page.cc.
References buf_block_struct::frame, page_dir_print(), page_header_print(), page_print(), and page_print_list().
Referenced by page_print().
UNIV_INTERN void page_print_list | ( | buf_block_t * | block, |
dict_index_t * | index, | ||
ulint | pr_n | ||
) |
This is used to print the contents of the page record list for debugging purposes. in: print n first and n last entries
This is used to print the contents of the page record list for debugging purposes.
block | in: index page |
index | in: dictionary index of the page |
pr_n | in: print n first and n last entries |
Definition at line 1669 of file page0page.cc.
References dict_table_is_comp(), buf_block_struct::frame, mem_heap_free, page_cur_is_after_last(), page_cur_move_to_next(), page_cur_set_before_first(), page_get_n_recs(), page_is_comp(), page_print_list(), page_rec_print(), page_cur_struct::rec, dict_index_struct::table, and ut_a.
Referenced by page_print(), and page_print_list().
UNIV_INLINE ibool page_rec_check | ( | const rec_t * | rec | ) |
Used to check the consistency of a record on a page.
Referenced by page_dir_find_owner_slot(), page_rec_get_n_recs_before(), page_rec_print(), and page_rec_validate().
UNIV_INLINE rec_t* page_rec_find_owner_rec | ( | rec_t * | rec | ) |
Looks for the record which owns the given record.
Referenced by page_cur_insert_rec_low(), and page_cur_insert_rec_zip().
UNIV_INLINE ulint page_rec_get_base_extra_size | ( | const rec_t * | rec | ) |
Returns the base extra size of a physical record. This is the size of the fixed header, independent of the record size.
UNIV_INLINE ulint page_rec_get_heap_no | ( | const rec_t * | rec | ) |
Returns the heap number of a record.
Referenced by lock_clust_rec_read_check_and_lock(), lock_rec_insert_check_and_lock(), lock_rec_restore_from_page_infimum(), lock_rec_store_on_page_infimum(), lock_rec_unlock(), lock_sec_rec_modify_check_and_lock(), lock_sec_rec_read_check_and_lock(), lock_update_merge_left(), and lock_update_merge_right().
UNIV_INTERN ulint page_rec_get_n_recs_before | ( | const rec_t * | rec | ) |
Returns the number of records before the given record in chain. The number includes infimum and supremum records.
Returns the number of records before the given record in chain. The number includes infimum and supremum records.
rec | in: the physical record |
Definition at line 1533 of file page0page.cc.
References page_align(), page_dir_slot_get_rec(), page_is_comp(), page_rec_check(), page_rec_get_n_recs_before(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_get_next_ptr_const(), and ut_ad.
Referenced by page_copy_rec_list_end(), page_copy_rec_list_start(), and page_rec_get_n_recs_before().
UNIV_INLINE rec_t* page_rec_get_next | ( | rec_t * | rec | ) |
Gets the pointer to the next record on the page.
Referenced by btr_cur_pessimistic_delete(), btr_cur_pessimistic_insert(), btr_discard_page(), btr_estimate_number_of_different_key_vals(), btr_get_next_user_rec(), btr_page_get_split_rec_to_left(), btr_page_get_split_rec_to_right(), btr_page_split_and_insert(), btr_pcur_store_position(), btr_root_raise_and_insert(), btr_search_update_hash_node_on_insert(), btr_search_update_hash_on_insert(), page_copy_rec_list_end(), page_copy_rec_list_end_to_created_page(), page_cur_delete_rec(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_delete_rec_list_end(), page_dir_split_slot(), page_get_middle_rec(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), and page_zip_dir_insert().
UNIV_INLINE const rec_t* page_rec_get_next_const | ( | const rec_t * | rec | ) |
Gets the pointer to the next record on the page.
Referenced by lock_rec_insert_check_and_lock(), lock_update_merge_left(), page_cur_search_with_match(), and row_search_for_mysql().
UNIV_INLINE const rec_t* page_rec_get_next_low | ( | const rec_t * | rec, |
ulint | comp | ||
) |
Gets the pointer to the next record on the page.
rec | in: pointer to record |
Referenced by btr_search_drop_page_hash_index(), and lock_update_insert().
UNIV_INLINE rec_t* page_rec_get_prev | ( | rec_t * | rec | ) |
Gets the pointer to the previous record.
Referenced by btr_get_prev_user_rec(), btr_pcur_store_position(), page_copy_rec_list_start(), page_cur_parse_insert_rec(), and page_delete_rec_list_end().
UNIV_INLINE const rec_t* page_rec_get_prev_const | ( | const rec_t * | rec | ) |
Gets the pointer to the previous record.
UNIV_INLINE ulint page_rec_is_comp | ( | const rec_t * | rec | ) |
TRUE if the record is on a page in compact format.
Referenced by btr_cur_del_mark_set_clust_rec(), btr_cur_del_mark_set_sec_rec(), btr_cur_optimistic_update(), btr_cur_update_in_place(), btr_search_drop_page_hash_index(), btr_set_min_rec_mark(), lock_move_rec_list_end(), lock_move_rec_list_start(), lock_update_insert(), mlog_open_and_write_index(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_delete_rec_list_end(), page_delete_rec_list_start(), page_rec_print(), page_rec_validate(), row_search_for_mysql(), row_vers_impl_x_locked_off_kernel(), and row_vers_old_has_index_entry().
UNIV_INLINE ibool page_rec_is_infimum | ( | const rec_t * | rec | ) | const |
TRUE if the record is the infimum record on a page.
rec | in: record |
Referenced by btr_get_prev_user_rec(), btr_search_update_hash_on_insert(), page_copy_rec_list_end_to_created_page(), page_copy_rec_list_start(), page_cur_search_with_match(), page_delete_rec_list_end(), page_delete_rec_list_start(), page_zip_dir_insert(), row_ins_check_foreign_constraint(), row_search_for_mysql(), row_search_index_entry(), and row_search_on_row_ref().
UNIV_INLINE ibool page_rec_is_infimum_low | ( | ulint | offset | ) | const |
TRUE if the record is the infimum record on a page.
offset | in: record offset on page |
Referenced by btr_pcur_store_position(), and page_check_dir().
UNIV_INLINE ibool page_rec_is_supremum | ( | const rec_t * | rec | ) | const |
TRUE if the record is the supremum record on a page.
rec | in: record |
Referenced by btr_get_next_user_rec(), btr_page_get_split_rec_to_right(), btr_search_drop_page_hash_index(), btr_search_guess_on_hash(), btr_search_update_hash_on_insert(), lock_clust_rec_read_check_and_lock(), lock_move_rec_list_start(), lock_sec_rec_read_check_and_lock(), lock_update_merge_left(), page_copy_rec_list_end_to_created_page(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), page_cur_search_with_match(), page_delete_rec_list_end(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), row_ins_check_foreign_constraint(), and row_search_for_mysql().
UNIV_INLINE ibool page_rec_is_supremum_low | ( | ulint | offset | ) | const |
TRUE if the record is the supremum record on a page.
offset | in: record offset on page |
Referenced by btr_pcur_store_position(), and page_check_dir().
UNIV_INLINE ibool page_rec_is_user_rec | ( | const rec_t * | rec | ) | const |
TRUE if the record is a user record on the page.
rec | in: record |
Referenced by btr_discard_page(), btr_search_guess_on_hash(), lock_clust_rec_cons_read_sees(), lock_clust_rec_read_check_and_lock(), lock_sec_rec_cons_read_sees(), lock_sec_rec_read_check_and_lock(), page_cur_delete_rec(), and page_validate().
UNIV_INLINE ibool page_rec_is_user_rec_low | ( | ulint | offset | ) | const |
TRUE if the record is a user record on the page.
offset | in: record offset on page |
UNIV_INTERN void page_rec_print | ( | const rec_t * | rec, |
const ulint * | offsets | ||
) |
Prints record contents including the data relevant only in the index page context. in: record descriptor
Prints record contents including the data relevant only in the index page context.
rec | in: physical record |
offsets | in: record descriptor |
Definition at line 1597 of file page0page.cc.
References page_rec_check(), page_rec_is_comp(), page_rec_print(), rec_get_heap_no_new(), rec_get_heap_no_old(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_get_next_offs(), rec_offs_comp(), rec_print_new(), rec_validate(), and ut_a.
Referenced by page_print_list(), and page_rec_print().
UNIV_INLINE void page_rec_set_next | ( | rec_t * | rec, |
rec_t * | next | ||
) |
Sets the pointer to the next record on the page. in: pointer to next record, must not be page infimum
rec | in: pointer to record, must not be page supremum |
Referenced by page_cur_delete_rec(), page_cur_insert_rec_low(), page_cur_insert_rec_zip(), and page_delete_rec_list_end().
UNIV_INTERN ibool page_rec_validate | ( | rec_t * | rec, |
const ulint * | offsets | ||
) |
The following is used to validate a record on a page. This function differs from rec_validate as it can also check the n_owned field and the heap_no field.
The following is used to validate a record on a page. This function differs from rec_validate as it can also check the n_owned field and the heap_no field.
rec | in: physical record |
offsets | in: array returned by rec_get_offsets() |
Definition at line 1791 of file page0page.cc.
References page_align(), page_dir_get_n_heap(), page_is_comp(), page_offset(), page_rec_check(), page_rec_is_comp(), page_rec_validate(), rec_get_heap_no_new(), rec_get_heap_no_old(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_offs_comp(), rec_validate(), and ut_a.
Referenced by page_rec_validate(), and page_validate().
UNIV_INTERN void page_rec_write_index_page_no | ( | rec_t * | rec, |
ulint | i, | ||
ulint | page_no, | ||
mtr_t * | mtr | ||
) |
This is a low-level operation which is used in a database index creation to update the page number of a created B-tree to a data dictionary record. in: mtr
This is a low-level operation which is used in a database index creation to update the page number of a created B-tree to a data dictionary record.
rec | in: record to update |
i | in: index of the field to update |
page_no | in: value to write |
mtr | in: mtr |
Definition at line 1249 of file page0page.cc.
References MLOG_4BYTES, mlog_write_ulint(), page_rec_write_index_page_no(), and ut_ad.
Referenced by dict_drop_index_tree(), dict_truncate_index_tree(), page_rec_write_index_page_no(), and row_truncate_table_for_mysql().
UNIV_INTERN void page_set_max_trx_id | ( | buf_block_t * | block, |
page_zip_des_t * | page_zip, | ||
trx_id_t | trx_id, | ||
mtr_t * | mtr | ||
) |
Sets the max trx id field value. in/out: mini-transaction, or NULL
Sets the max trx id field value.
block | in/out: page |
page_zip | in/out: compressed page, or NULL |
trx_id | in: transaction id |
mtr | in/out: mini-transaction, or NULL |
Definition at line 207 of file page0page.cc.
References btr_search_latch, buf_block_struct::is_hashed, mach_write_to_8(), mlog_write_ull(), page_set_max_trx_id(), page_zip_write_header(), and ut_ad.
Referenced by page_set_max_trx_id(), and page_zip_reorganize().
UNIV_INTERN ibool page_simple_validate_new | ( | page_t * | page | ) |
This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash even if the page is total garbage.
This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash even if the page is total garbage.
page | in: new-style index page |
Definition at line 2087 of file page0page.cc.
References FIL_PAGE_DATA, page_dir_get_n_heap(), page_dir_get_n_slots(), page_dir_slot_get_rec(), page_header_get_field(), page_header_get_ptr, page_is_comp(), page_offset(), page_rec_get_next(), page_rec_is_supremum(), page_simple_validate_new(), rec_get_n_owned_new(), rec_get_next_offs(), and ut_a.
Referenced by page_simple_validate_new(), page_validate(), page_zip_write_rec(), and page_zip_write_trx_id_and_roll_ptr().
UNIV_INTERN ibool page_simple_validate_old | ( | page_t * | page | ) |
This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash even if the page is total garbage.
This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash even if the page is total garbage.
page | in: old-style index page |
Definition at line 1877 of file page0page.cc.
References FIL_PAGE_DATA, page_dir_get_n_heap(), page_dir_get_n_slots(), page_dir_slot_get_rec(), page_header_get_field(), page_header_get_ptr, page_is_comp(), page_offset(), page_rec_get_next(), page_rec_is_supremum(), page_simple_validate_old(), rec_get_n_owned_old(), rec_get_next_offs(), and ut_a.
Referenced by page_simple_validate_old(), and page_validate().
UNIV_INLINE void page_update_max_trx_id | ( | buf_block_t * | block, |
page_zip_des_t * | page_zip, | ||
trx_id_t | trx_id, | ||
mtr_t * | mtr | ||
) |
Sets the max trx id field value if trx_id is bigger than the previous value. in/out: mini-transaction
block | in/out: page |
page_zip | in/out: compressed page whose uncompressed part will be updated, or NULL |
trx_id | in: transaction id |
Referenced by btr_cur_pessimistic_update(), lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock(), page_copy_rec_list_end(), and page_copy_rec_list_start().
UNIV_INTERN ibool page_validate | ( | page_t * | page, |
dict_index_t * | index | ||
) |
This function checks the consistency of an index page.
This function checks the consistency of an index page.
page | in: index page |
index | in: data dictionary index containing the page record type definition |
Definition at line 2296 of file page0page.cc.
References cmp_rec_rec(), dict_table_is_comp(), mem_heap_create, mem_heap_free, mem_heap_zalloc(), dict_index_struct::name, page_dir_get_n_heap(), page_dir_get_n_slots(), page_dir_slot_get_rec(), page_get_data_size(), page_get_page_no(), page_get_space_id(), page_header_get_field(), page_header_get_ptr, page_is_comp(), page_is_leaf(), page_offset(), page_rec_get_next(), page_rec_is_supremum(), page_rec_is_user_rec(), page_rec_validate(), page_simple_validate_new(), page_simple_validate_old(), page_validate(), rec_get_n_owned_new(), rec_get_n_owned_old(), rec_get_node_ptr_flag(), rec_get_start(), rec_offs_size(), rec_print_new(), and dict_index_struct::table.
Referenced by btr_compress(), btr_page_split_and_insert(), ibuf_update_max_tablespace_id(), page_copy_rec_list_end(), page_copy_rec_list_start(), and page_validate().