|
drizzle
C++ MySQL-protocol-compatible database server
|
#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) |
| #define | page_get_supremum_rec(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 (const rec_t *rec, const ulint *offsets) |
| UNIV_INTERN void | page_check_dir (const page_t *page) |
| UNIV_INTERN ibool | page_simple_validate_old (const page_t *page) |
| UNIV_INTERN ibool | page_simple_validate_new (const page_t *page) |
| UNIV_INTERN ibool | page_validate (const 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 page0page_h |
Definition at line 28 of file page0page.h.
| #define PAGE_BTR_IBUF_FREE_LIST PAGE_BTR_SEG_LEAF |
Definition at line 70 of file page0page.h.
| #define PAGE_BTR_IBUF_FREE_LIST_NODE PAGE_BTR_SEG_LEAF |
Definition at line 71 of file page0page.h.
| #define PAGE_BTR_SEG_LEAF |
Definition at line 69 of file page0page.h.
| #define PAGE_BTR_SEG_TOP (36 + FSEG_HEADER_SIZE) |
Definition at line 77 of file page0page.h.
| #define PAGE_DATA (PAGE_HEADER + 36 + 2 * FSEG_HEADER_SIZE) |
Definition at line 83 of file page0page.h.
| #define PAGE_DIR FIL_PAGE_DATA_END |
Definition at line 128 of file page0page.h.
| #define page_dir_get_nth_slot | ( | page, | |
| n ) |
Definition at line 387 of file page0page.h.
| #define PAGE_DIR_SLOT_MAX_N_OWNED 8 |
Definition at line 140 of file page0page.h.
| #define PAGE_DIR_SLOT_MIN_N_OWNED 4 |
Definition at line 141 of file page0page.h.
| #define PAGE_DIR_SLOT_SIZE 2 |
Definition at line 131 of file page0page.h.
| #define PAGE_DIRECTION 12 /* last insert direction: PAGE_LEFT, ... */ |
Definition at line 61 of file page0page.h.
| #define PAGE_EMPTY_DIR_START (PAGE_DIR + 2 * PAGE_DIR_SLOT_SIZE) |
Definition at line 135 of file page0page.h.
| #define PAGE_FREE 6 /* pointer to start of page free record list */ |
Definition at line 58 of file page0page.h.
| #define PAGE_GARBAGE 8 /* number of bytes in deleted records */ |
Definition at line 59 of file page0page.h.
| #define page_get_infimum_rec | ( | page | ) |
Definition at line 265 of file page0page.h.
| #define page_get_supremum_rec | ( | page | ) |
Definition at line 266 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.
| #define PAGE_HEADER_PRIV_END |
Definition at line 65 of file page0page.h.
| #define PAGE_HEAP_NO_INFIMUM 0 /* page infimum */ |
Definition at line 107 of file page0page.h.
| #define PAGE_HEAP_NO_SUPREMUM 1 /* page supremum */ |
Definition at line 108 of file page0page.h.
| #define PAGE_HEAP_NO_USER_LOW |
Definition at line 109 of file page0page.h.
| #define PAGE_HEAP_TOP 2 /* pointer to record heap top */ |
Definition at line 56 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_LEFT 1 |
Definition at line 112 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_DIR_SLOTS 0 /* number of slots in page directory */ |
Definition at line 55 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.
| #define PAGE_N_RECS 16 /* number of user records on the page */ |
Definition at line 63 of file page0page.h.
| #define PAGE_NEW_INFIMUM (PAGE_DATA + REC_N_NEW_EXTRA_BYTES) |
Definition at line 95 of file page0page.h.
| #define PAGE_NEW_SUPREMUM (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8) |
Definition at line 98 of file page0page.h.
| #define PAGE_NEW_SUPREMUM_END (PAGE_NEW_SUPREMUM + 8) |
Definition at line 101 of file page0page.h.
| #define PAGE_NO_DIRECTION 5 |
Definition at line 116 of file page0page.h.
| #define PAGE_OLD_INFIMUM (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES) |
Definition at line 86 of file page0page.h.
| #define PAGE_OLD_SUPREMUM (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8) |
Definition at line 89 of file page0page.h.
| #define PAGE_OLD_SUPREMUM_END (PAGE_OLD_SUPREMUM + 9) |
Definition at line 92 of file page0page.h.
| #define PAGE_RIGHT 2 |
Definition at line 113 of file page0page.h.
| #define PAGE_SAME_PAGE 4 |
Definition at line 115 of file page0page.h.
| #define PAGE_SAME_REC 3 |
Definition at line 114 of file page0page.h.
| typedef byte page_dir_slot_t |
Definition at line 122 of file page0page.h.
| typedef page_dir_slot_t page_dir_t |
Definition at line 123 of file page0page.h.
| typedef byte page_header_t |
Definition at line 51 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 |
| 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 1850 of file page0page.cc.
| 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 |
| 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.
| 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.
| 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 726 of file page0page.cc.
| 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.
| 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.
| 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 930 of file page0page.cc.
| 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 1109 of file page0page.cc.
| 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 1423 of file page0page.cc.
| 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.
| UNIV_INLINE ulint page_dir_get_n_heap | ( | const page_t * | page | ) |
Gets the number of records in the heap.
| UNIV_INLINE ulint page_dir_get_n_slots | ( | const page_t * | page | ) |
Gets the number of dir slots in directory.
| 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 1638 of file page0page.cc.
| 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. |
| 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 |
| 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.
| 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.
| 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 |
| 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 |
| 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 1360 of file page0page.cc.
| 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 2594 of file page0page.cc.
| 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.
| 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 |
| 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 |
| 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 |
Returns the max trx id field value. in: page
| 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 1495 of file page0page.cc.
| 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).
| UNIV_INLINE ulint page_get_page_no | ( | const page_t * | page | ) |
Gets the page number.
| UNIV_INLINE ulint page_get_space_id | ( | const page_t * | page | ) |
Gets the tablespace identifier.
| 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 |
| 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 1750 of file page0page.cc.
| 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, ... |
| 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, ... |
| UNIV_INLINE ulint page_is_comp | ( | const page_t * | page | ) |
Determine whether the page is in new-style compact format.
| UNIV_INLINE ibool page_is_leaf | ( | const page_t * | page | ) |
Determine whether the page is a B-tree leaf.
| page | in: page |
| 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 |
| 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.
| 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 |
| 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 |
| 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 |
| UNIV_INLINE ulint page_offset | ( | const void * | ptr | ) | const |
Gets the offset within a page.
| ptr | in: pointer to page frame |
| UNIV_INTERN byte * page_parse_create | ( | byte * | ptr, |
| byte * | end_ptr, | ||
| 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 |
| end_ptr | in: buffer end |
| comp | in: nonzero=compact page format |
| block | in: block or NULL |
| mtr | in: mtr or NULL |
Definition at line 313 of file page0page.cc.
| 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 874 of file page0page.cc.
| 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 1778 of file page0page.cc.
| 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 1680 of file page0page.cc.
| UNIV_INLINE ibool page_rec_check | ( | const rec_t * | rec | ) |
Used to check the consistency of a record on a page.
| UNIV_INLINE rec_t * page_rec_find_owner_rec | ( | rec_t * | rec | ) |
Looks for the record which owns the given record.
| 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.
| 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 1544 of file page0page.cc.
| UNIV_INLINE rec_t * page_rec_get_next | ( | rec_t * | rec | ) |
Gets the pointer to the next record on the page.
| UNIV_INLINE const rec_t * page_rec_get_next_const | ( | const rec_t * | rec | ) |
Gets the pointer to the next record on the page.
| 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 |
| UNIV_INLINE rec_t * page_rec_get_prev | ( | rec_t * | rec | ) |
Gets the pointer to the previous record.
| 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.
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 1608 of file page0page.cc.
| 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 |
| UNIV_INTERN ibool page_rec_validate | ( | const 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 1802 of file page0page.cc.
| 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 1260 of file page0page.cc.
| 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.
| UNIV_INTERN ibool page_simple_validate_new | ( | const 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: index page in ROW_FORMAT!=REDUNDANT |
Definition at line 2098 of file page0page.cc.
| UNIV_INTERN ibool page_simple_validate_old | ( | const 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: index page in ROW_FORMAT=REDUNDANT |
Definition at line 1888 of file page0page.cc.
| 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 |
| UNIV_INTERN ibool page_validate | ( | const 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 2307 of file page0page.cc.
| UNIV_INLINE ibool pure |
Definition at line 218 of file page0page.h.