87 0x69, 0x6e, 0x66, 0x69, 0x6d, 0x75, 0x6d, 0x00
196 ulint field,
const byte *ptr);
197#ifndef UNIV_HOTBACKUP
245#ifndef UNIV_HOTBACKUP
310#define page_dir_get_nth_slot(page, n) \
311 ((page) + (UNIV_PAGE_SIZE - PAGE_DIR - (n + 1) * PAGE_DIR_SLOT_SIZE))
545 const ulint *offsets);
709#ifndef UNIV_HOTBACKUP
744 const ulint *offsets);
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:52
uint32_t page_no_t
Page number.
Definition: api0api.h:50
The database buffer pool high-level routines.
srv_checksum_algorithm_t
Alternatives for srv_checksum_algorithm, which can be changed by setting innodb_checksum_algorithm.
Definition: buf0types.h:115
Page identifier.
Definition: buf0types.h:207
int page
Definition: ctype-mb.cc:1236
SQL data field and tuple.
The low-level file system.
uint16_t page_type_t
Definition: fil0fil.h:1193
constexpr uint32_t FIL_PAGE_DATA_END
size of the page trailer
Definition: fil0types.h:119
uint32_t node_seq_t
Definition: gis0type.h:58
mlog_id_t
Definition: mtr0types.h:63
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.
Definition: page0page.cc:874
byte page_dir_slot_t
Definition: page0page.h:55
page_t * page_create_zip(buf_block_t *block, dict_index_t *index, ulint level, trx_id_t max_trx_id, mtr_t *mtr, page_type_t page_type)
Create a compressed B-tree index page.
Definition: page0page.cc:391
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.
Definition: page0page.cc:197
static const byte supremum_extra_data[]
Extra bytes and data bytes of a supremum record.
Definition: page0page.h:90
static ulint page_header_get_offs(const page_t *page, ulint field)
Returns the offset stored in the given header field.
constexpr uint32_t PAGE_DIR_SLOT_MAX_N_OWNED
Definition: page0page.h:73
static bool page_rec_is_comp(const rec_t *rec)
true if the record is on a page in compact format.
static 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.
static rec_t * page_rec_get_prev(rec_t *rec)
Gets the pointer to the previous record.
static const rec_t * page_rec_get_prev_const(const rec_t *rec)
Gets the pointer to the previous record.
static 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.
static rec_t * page_rec_get_nth(page_t *page, ulint nth)
Returns the nth record of the record list.
static bool page_rec_is_supremum(const rec_t *rec)
true if the record is the supremum record on a page.
static 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.
void page_create_empty(buf_block_t *block, dict_index_t *index, mtr_t *mtr)
Empty a previously created B-tree index page.
Definition: page0page.cc:430
static rec_t * page_rec_get_next(rec_t *rec)
Gets the pointer to the next record on the page.
ulint page_dir_find_owner_slot(const rec_t *rec)
Looks for the directory slot which owns the given record.
Definition: page0page.cc:94
constexpr uint32_t PAGE_DIR_SLOT_SIZE
Definition: page0page.h:64
static 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.
static bool page_rec_is_first(const rec_t *rec, const page_t *page)
true if the record is the first user record on a page.
static bool page_is_empty(const page_t *page)
Determine whether the page is empty.
ulint page_rec_get_n_recs_before(const rec_t *rec)
Returns the number of records before the given record in chain.
Definition: page0page.cc:1456
static ulint page_get_free_space_of_empty(bool comp)
Calculates free space if a page is emptied.
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.
Definition: page0page.cc:1729
static 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.
static bool page_rec_check(const rec_t *rec)
Used to check the consistency of a record on a page.
constexpr uint32_t PAGE_DIR_SLOT_MIN_N_OWNED
Definition: page0page.h:74
static uint16_t page_dir_get_n_heap(const page_t *page)
Gets the number of records in the heap.
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,...
Definition: page0page.cc:1347
page_dir_slot_t page_dir_t
Definition: page0page.h:56
static const byte infimum_extra[]
Extra bytes of an infimum record.
Definition: page0page.h:80
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.
Definition: page0page.cc:531
bool 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.
Definition: page0page.cc:1144
bool page_is_spatial_non_leaf(const rec_t *rec, dict_index_t *index)
This function checks if the page in which record is present is a non-leaf node of a spatial index.
Definition: page0page.cc:2122
static uint16_t page_header_get_field(const page_t *page, ulint field)
Reads the given header field.
static 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.
void page_parse_create(buf_block_t *block, ulint comp, page_type_t page_type)
Parses a redo log record of creating a page.
Definition: page0page.cc:363
static bool page_rec_is_supremum_low(ulint offset)
true if the record is the supremum record on a page.
static bool page_rec_is_user_rec_low(ulint offset)
true if the record is a user record on the page.
static bool page_rec_is_infimum_low(ulint offset)
true if the record is the infimum record on a page.
static ulint page_dir_calc_reserved_space(ulint n_recs)
Calculates the space reserved for directory slots of a given number of records.
bool page_rec_validate(const rec_t *rec, const ulint *offsets)
The following is used to validate a record on a page.
Definition: page0page.cc:1680
static rec_t * page_get_middle_rec(page_t *page)
Returns the middle record of the records on the page.
static 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.
static bool page_rec_is_second(const rec_t *rec, const page_t *page)
true if the record is the second user record on a page.
static 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.
static byte * page_header_get_ptr(page_t *page, uint32_t field)
Returns the pointer stored in the given header field, or NULL.
Definition: page0page.h:174
void page_warn_strict_checksum(srv_checksum_algorithm_t curr_algo, srv_checksum_algorithm_t page_checksum, const page_id_t &page_id)
Issue a warning when the checksum that is stored in the page is valid, but different than the global ...
Definition: page0page.cc:2630
static bool page_rec_is_infimum(const rec_t *rec)
true if the record is the infimum record on a page.
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 ...
Definition: page0page.cc:467
static bool page_is_root(const page_t *page)
Determine whether a page is an index root page.
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.
Definition: page0page.cc:1289
bool page_simple_validate_new(const page_t *page)
This function checks the consistency of an index page when we do not know the index.
Definition: page0page.cc:1939
static page_no_t page_get_page_no(const page_t *page)
Gets the page number.
static page_dir_slot_t * page_dir_get_nth_slot(const page_t *page, ulint n)
Gets pointer to nth directory slot.
static ulint page_dir_slot_get_n_owned(const page_dir_slot_t *slot)
Gets the number of records owned by a directory slot.
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.
Definition: page0page.cc:1069
static page_id_t page_get_page_id(const page_t *page)
Gets the space id and page number identifying the page.
static const rec_t * page_dir_slot_get_rec(const page_dir_slot_t *slot)
Gets the record pointed to by a directory slot.
static void page_rec_set_next(rec_t *rec, const rec_t *next)
Sets the pointer to the next record on the page.
static bool page_rec_is_last(const rec_t *rec, const page_t *page)
true if the record is the last user record on a page.
static bool page_rec_is_second_last(const rec_t *rec, const page_t *page)
true if the record is the second last user record on a page.
static 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 f...
static ulint page_rec_get_heap_no(const rec_t *rec)
Returns the heap number of a record.
static trx_id_t page_get_max_trx_id(const page_t *page)
Returns the max trx id field value.
static ulint page_offset(const void *ptr)
Gets the offset within a page.
static void page_mem_free(page_t *page, page_zip_des_t *page_zip, rec_t *rec, const dict_index_t *index, const ulint *offsets)
Puts a record to free list.
static 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).
void page_rec_print(const rec_t *rec, const ulint *offsets)
Prints record contents including the data relevant only in the index page context.
Definition: page0page.cc:1515
static 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.
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.
Definition: page0page.cc:2517
static ulint page_get_infimum_offset(const page_t *page)
Gets the offset of the first record on the page.
static 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 rec...
bool 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.
Definition: page0page.cc:1197
static node_seq_t page_get_ssn_id(const page_t *page)
Returns the RTREE SPLIT SEQUENCE NUMBER (FIL_RTREE_SPLIT_SEQ_NUM).
static const rec_t * page_rec_get_next_low(const rec_t *rec, ulint comp)
Gets the pointer to the next record on the page.
static void page_header_set_field(page_t *page, page_zip_des_t *page_zip, ulint field, ulint val)
Sets the given header field.
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.
Definition: page0page.cc:668
static ulint page_get_supremum_offset(const page_t *page)
Gets the offset of the last record on the page.
const rec_t * page_rec_get_nth_const(const page_t *page, ulint nth)
Returns the nth record of the record list.
Definition: page0page.cc:1409
static const rec_t * page_rec_get_next_non_del_marked(const rec_t *rec)
Gets the pointer to the next non delete-marked record on the page.
static ulint page_rec_get_base_extra_size(const rec_t *rec)
Returns the base extra size of a physical record.
static bool page_is_comp(const page_t *page)
Determine whether the page is in new-style compact format.
static const byte infimum_data[]
Data bytes of an infimum record.
Definition: page0page.h:86
static bool page_has_garbage(const page_t *page)
Determine whether the page contains garbage.
static space_id_t page_get_space_id(const page_t *page)
Gets the tablespace identifier.
const rec_t * page_find_rec_last_not_deleted(const page_t *page)
Get the last non-delete-marked record on a page.
Definition: page0page.cc:2600
static ulint page_dir_get_n_slots(const page_t *page)
Gets the number of dir slots in directory.
static bool page_rec_is_user_rec(const rec_t *rec)
true if the record is a user record on the page.
static bool page_rec_distance_is_at_most(const rec_t *left_rec, const rec_t *right_rec, ulint val)
true if distance between the records (measured in number of times we have to move to the next record)...
bool page_validate(const page_t *page, dict_index_t *index)
This function checks the consistency of an index page.
Definition: page0page.cc:2126
byte * page_parse_delete_rec_list(mlog_id_t 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.
Definition: page0page.cc:824
static byte * page_get_infimum_rec(byte *page)
Definition: page0page.h:218
constexpr uint32_t PAGE_DIR
Definition: page0page.h:61
bool page_simple_validate_old(const page_t *page)
This function checks the consistency of an index page when we do not know the index.
Definition: page0page.cc:1758
page_t * page_create(buf_block_t *block, mtr_t *mtr, ulint comp, page_type_t page_type)
Create an uncompressed B-tree or R-tree or SDI index page.
Definition: page0page.cc:375
constexpr uint32_t PAGE_EMPTY_DIR_START
Definition: page0page.h:68
static rec_t * page_rec_find_owner_rec(rec_t *rec)
Looks for the record which owns the given record.
ulong page_size_validate(ulong page_size)
Check that a page_size is correct for InnoDB.
Definition: page0page.ic:927
static page_t * page_align(const void *ptr)
Gets the start of a page.
static bool page_is_leaf(const page_t *page)
Determine whether the page is a B-tree leaf.
static void page_set_ssn_id(buf_block_t *block, page_zip_des_t *page_zip, node_seq_t ssn_id, mtr_t *mtr)
Sets the RTREE SPLIT SEQUENCE NUMBER field value.
static byte * page_get_supremum_rec(byte *page)
Definition: page0page.h:224
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.
Definition: page0page.cc:223
static const rec_t * page_rec_get_next_const(const rec_t *rec)
Gets the pointer to the next record on the page.
byte page_t
Type of the index page.
Definition: page0types.h:152
byte rec_t
Definition: rem0types.h:41
required string type
Definition: replication_group_member_actions.proto:34
The buffer control block structure.
Definition: buf0buf.h:1690
Data structure for an index.
Definition: dict0mem.h:1046
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Compressed page descriptor.
Definition: page0types.h:200
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406
int n
Definition: xcom_base.cc:509