summaryrefslogtreecommitdiff
path: root/storage/innobase/include/page0page.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/page0page.h')
-rw-r--r--storage/innobase/include/page0page.h329
1 files changed, 177 insertions, 152 deletions
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index e8b4265bc68..3bb622127fb 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -36,7 +36,9 @@ Created 2/2/1994 Heikki Tuuri
#include "data0data.h"
#include "dict0dict.h"
#include "rem0rec.h"
+#endif /* !UNIV_INNOCHECKSUM*/
#include "fsp0fsp.h"
+#ifndef UNIV_INNOCHECKSUM
#include "mtr0mtr.h"
#ifdef UNIV_MATERIALIZE
@@ -44,14 +46,13 @@ Created 2/2/1994 Heikki Tuuri
#define UNIV_INLINE
#endif
-#endif /* !UNIV_INNOCHECKSUM */
-
/* PAGE HEADER
===========
Index page header starts at the first offset left free by the FIL-module */
typedef byte page_header_t;
+#endif /* !UNIV_INNOCHECKSUM */
#define PAGE_HEADER FSEG_PAGE_DATA /* index page header starts at this
offset */
@@ -82,6 +83,9 @@ typedef byte page_header_t;
#define PAGE_INDEX_ID 28 /* index id where the page belongs.
This field should not be written to after
page creation. */
+
+#ifndef UNIV_INNOCHECKSUM
+
#define PAGE_BTR_SEG_LEAF 36 /* file segment header for the leaf pages in
a B-tree: defined only on the root page of a
B-tree, but not in the root of an ibuf tree */
@@ -121,8 +125,6 @@ typedef byte page_header_t;
a new-style compact page */
/*-----------------------------*/
-#ifndef UNIV_INNOCHECKSUM
-
/* Heap numbers */
#define PAGE_HEAP_NO_INFIMUM 0 /* page infimum */
#define PAGE_HEAP_NO_SUPREMUM 1 /* page supremum */
@@ -167,7 +169,7 @@ extern my_bool srv_immediate_scrub_data_uncompressed;
/************************************************************//**
Gets the start of a page.
-@return start of the page */
+@return start of the page */
UNIV_INLINE
page_t*
page_align(
@@ -176,7 +178,7 @@ page_align(
MY_ATTRIBUTE((const));
/************************************************************//**
Gets the offset within a page.
-@return offset from the start of the page */
+@return offset from the start of the page */
UNIV_INLINE
ulint
page_offset(
@@ -192,7 +194,6 @@ page_get_max_trx_id(
const page_t* page); /*!< in: page */
/*************************************************************//**
Sets the max trx id field value. */
-UNIV_INTERN
void
page_set_max_trx_id(
/*================*/
@@ -213,6 +214,27 @@ page_update_max_trx_id(
trx_id_t trx_id, /*!< in: transaction id */
mtr_t* mtr); /*!< in/out: mini-transaction */
/*************************************************************//**
+Returns the RTREE SPLIT SEQUENCE NUMBER (FIL_RTREE_SPLIT_SEQ_NUM).
+@return SPLIT SEQUENCE NUMBER */
+UNIV_INLINE
+node_seq_t
+page_get_ssn_id(
+/*============*/
+ const page_t* page); /*!< in: page */
+/*************************************************************//**
+Sets the RTREE SPLIT SEQUENCE NUMBER field value */
+UNIV_INLINE
+void
+page_set_ssn_id(
+/*============*/
+ buf_block_t* block, /*!< in/out: page */
+ page_zip_des_t* page_zip,/*!< in/out: compressed page whose
+ uncompressed part will be updated, or NULL */
+ node_seq_t ssn_id, /*!< in: split sequence id */
+ mtr_t* mtr); /*!< in/out: mini-transaction */
+
+#endif /* !UNIV_INNOCHECKSUM */
+/*************************************************************//**
Reads the given header field. */
UNIV_INLINE
ulint
@@ -220,6 +242,8 @@ page_header_get_field(
/*==================*/
const page_t* page, /*!< in: page */
ulint field); /*!< in: PAGE_N_DIR_SLOTS, ... */
+
+#ifndef UNIV_INNOCHECKSUM
/*************************************************************//**
Sets the given header field. */
UNIV_INLINE
@@ -233,14 +257,14 @@ page_header_set_field(
ulint val); /*!< in: value */
/*************************************************************//**
Returns the offset stored in the given header field.
-@return offset from the start of the page, or 0 */
+@return offset from the start of the page, or 0 */
UNIV_INLINE
ulint
page_header_get_offs(
/*=================*/
const page_t* page, /*!< in: page */
ulint field) /*!< in: PAGE_FREE, ... */
- MY_ATTRIBUTE((nonnull, pure));
+ MY_ATTRIBUTE((warn_unused_result));
/*************************************************************//**
Returns the pointer stored in the given header field, or NULL. */
@@ -273,7 +297,7 @@ page_header_reset_last_insert(
#endif /* !UNIV_HOTBACKUP */
/************************************************************//**
Gets the offset of the first record on the page.
-@return offset of the first record in record list, relative from page */
+@return offset of the first record in record list, relative from page */
UNIV_INLINE
ulint
page_get_infimum_offset(
@@ -281,7 +305,7 @@ page_get_infimum_offset(
const page_t* page); /*!< in: page which must have record(s) */
/************************************************************//**
Gets the offset of the last record on the page.
-@return offset of the last record in record list, relative from page */
+@return offset of the last record in record list, relative from page */
UNIV_INLINE
ulint
page_get_supremum_offset(
@@ -293,8 +317,7 @@ page_get_supremum_offset(
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
-UNIV_INTERN
+@return nth record */
const rec_t*
page_rec_get_nth_const(
/*===================*/
@@ -304,7 +327,7 @@ page_rec_get_nth_const(
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
+@return nth record */
UNIV_INLINE
rec_t*
page_rec_get_nth(
@@ -312,87 +335,59 @@ page_rec_get_nth(
page_t* page, /*< in: page */
ulint nth) /*!< in: nth record */
MY_ATTRIBUTE((nonnull, warn_unused_result));
-
#ifndef UNIV_HOTBACKUP
/************************************************************//**
Returns the middle record of the records on the page. If there is an
even number of records in the list, returns the first record of the
upper half-list.
-@return middle record */
+@return middle record */
UNIV_INLINE
rec_t*
page_get_middle_rec(
/*================*/
page_t* page) /*!< in: page */
MY_ATTRIBUTE((nonnull, warn_unused_result));
-/*************************************************************//**
-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.
-@return 1, 0, -1, if dtuple is greater, equal, less than rec,
-respectively, when only the common first fields are compared */
-UNIV_INLINE
-int
-page_cmp_dtuple_rec_with_match(
-/*===========================*/
- const dtuple_t* dtuple, /*!< in: data tuple */
- const rec_t* rec, /*!< in: physical record on a page; may also
- be page infimum or supremum, in which case
- matched-parameter values below are not
- affected */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
- ulint* matched_fields, /*!< in/out: number of already completely
- matched fields; when function returns
- contains the value for current comparison */
- ulint* matched_bytes); /*!< in/out: number of already matched
- bytes within the first field not completely
- matched; when function returns contains the
- value for current comparison */
#endif /* !UNIV_HOTBACKUP */
-#endif /* !UNIV_INNOCHECKSUM */
/*************************************************************//**
Gets the page number.
-@return page number */
+@return page number */
UNIV_INLINE
ulint
page_get_page_no(
/*=============*/
const page_t* page); /*!< in: page */
-#ifndef UNIV_INNOCHECKSUM
+
/*************************************************************//**
Gets the tablespace identifier.
-@return space id */
+@return space id */
UNIV_INLINE
ulint
page_get_space_id(
/*==============*/
const page_t* page); /*!< in: page */
-#endif /* !UNIV_INNOCHECKSUM */
+
/*************************************************************//**
Gets the number of user records on page (the infimum and supremum records
are not user records).
-@return number of user records */
+@return number of user records */
UNIV_INLINE
ulint
page_get_n_recs(
/*============*/
const page_t* page); /*!< in: index page */
-#ifndef UNIV_INNOCHECKSUM
+
/***************************************************************//**
Returns the number of records before the given record in chain.
The number includes infimum and supremum records.
This is the inverse function of page_rec_get_nth().
-@return number of records */
-UNIV_INTERN
+@return number of records */
ulint
page_rec_get_n_recs_before(
/*=======================*/
const rec_t* rec); /*!< in: the physical record */
/*************************************************************//**
Gets the number of records in the heap.
-@return number of user records */
+@return number of user records */
UNIV_INLINE
ulint
page_dir_get_n_heap(
@@ -413,7 +408,7 @@ page_dir_set_n_heap(
ulint n_heap);/*!< in: number of records */
/*************************************************************//**
Gets the number of dir slots in directory.
-@return number of slots */
+@return number of slots */
UNIV_INLINE
ulint
page_dir_get_n_slots(
@@ -432,7 +427,7 @@ page_dir_set_n_slots(
#ifdef UNIV_DEBUG
/*************************************************************//**
Gets pointer to nth directory slot.
-@return pointer to dir slot */
+@return pointer to dir slot */
UNIV_INLINE
page_dir_slot_t*
page_dir_get_nth_slot(
@@ -440,13 +435,13 @@ page_dir_get_nth_slot(
const page_t* page, /*!< in: index page */
ulint n); /*!< in: position */
#else /* UNIV_DEBUG */
-# define page_dir_get_nth_slot(page, n) \
- ((page) + UNIV_PAGE_SIZE - PAGE_DIR \
- - (n + 1) * PAGE_DIR_SLOT_SIZE)
+# define page_dir_get_nth_slot(page, n) \
+ ((page) + (UNIV_PAGE_SIZE - PAGE_DIR \
+ - (n + 1) * PAGE_DIR_SLOT_SIZE))
#endif /* UNIV_DEBUG */
/**************************************************************//**
Used to check the consistency of a record on a page.
-@return TRUE if succeed */
+@return TRUE if succeed */
UNIV_INLINE
ibool
page_rec_check(
@@ -454,7 +449,7 @@ page_rec_check(
const rec_t* rec); /*!< in: record */
/***************************************************************//**
Gets the record pointed to by a directory slot.
-@return pointer to record */
+@return pointer to record */
UNIV_INLINE
const rec_t*
page_dir_slot_get_rec(
@@ -470,7 +465,7 @@ page_dir_slot_set_rec(
rec_t* rec); /*!< in: record on the page */
/***************************************************************//**
Gets the number of records owned by a directory slot.
-@return number of records */
+@return number of records */
UNIV_INLINE
ulint
page_dir_slot_get_n_owned(
@@ -497,8 +492,7 @@ page_dir_calc_reserved_space(
ulint n_recs); /*!< in: number of records */
/***************************************************************//**
Looks for the directory slot which owns the given record.
-@return the directory slot number */
-UNIV_INTERN
+@return the directory slot number */
ulint
page_dir_find_owner_slot(
/*=====================*/
@@ -514,7 +508,7 @@ page_is_comp(
const page_t* page); /*!< in: index page */
/************************************************************//**
TRUE if the record is on a page in compact format.
-@return nonzero if in compact format */
+@return nonzero if in compact format */
UNIV_INLINE
ulint
page_rec_is_comp(
@@ -522,44 +516,50 @@ page_rec_is_comp(
const rec_t* rec); /*!< in: record */
/***************************************************************//**
Returns the heap number of a record.
-@return heap number */
+@return heap number */
UNIV_INLINE
ulint
page_rec_get_heap_no(
/*=================*/
const rec_t* rec); /*!< in: the physical record */
-#endif /* !UNIV_INNOCHECKSUM */
/************************************************************//**
Determine whether the page is a B-tree leaf.
-@return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */
+@return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */
UNIV_INLINE
bool
page_is_leaf(
/*=========*/
const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((nonnull, pure));
-#ifndef UNIV_INNOCHECKSUM
+ MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
Determine whether the page is empty.
-@return true if the page is empty (PAGE_N_RECS = 0) */
+@return true if the page is empty (PAGE_N_RECS = 0) */
UNIV_INLINE
bool
page_is_empty(
/*==========*/
const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((nonnull, pure));
+ MY_ATTRIBUTE((warn_unused_result));
+/** Determine whether a page is an index root page.
+@param[in] page page frame
+@return true if the page is a root page of an index */
+UNIV_INLINE
+bool
+page_is_root(
+ const page_t* page)
+ MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
Determine whether the page contains garbage.
-@return true if the page contains garbage (PAGE_GARBAGE is not 0) */
+@return true if the page contains garbage (PAGE_GARBAGE is not 0) */
UNIV_INLINE
bool
page_has_garbage(
/*=============*/
const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((nonnull, pure));
+ MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
Gets the pointer to the next record on the page.
-@return pointer to next record */
+@return pointer to next record */
UNIV_INLINE
const rec_t*
page_rec_get_next_low(
@@ -568,7 +568,7 @@ page_rec_get_next_low(
ulint comp); /*!< in: nonzero=compact page layout */
/************************************************************//**
Gets the pointer to the next record on the page.
-@return pointer to next record */
+@return pointer to next record */
UNIV_INLINE
rec_t*
page_rec_get_next(
@@ -576,7 +576,7 @@ page_rec_get_next(
rec_t* rec); /*!< in: pointer to record */
/************************************************************//**
Gets the pointer to the next record on the page.
-@return pointer to next record */
+@return pointer to next record */
UNIV_INLINE
const rec_t*
page_rec_get_next_const(
@@ -586,7 +586,7 @@ page_rec_get_next_const(
Gets the pointer to the next non delete-marked record on the page.
If all subsequent records are delete-marked, then this function
will return the supremum record.
-@return pointer to next non delete-marked record or pointer to supremum */
+@return pointer to next non delete-marked record or pointer to supremum */
UNIV_INLINE
const rec_t*
page_rec_get_next_non_del_marked(
@@ -604,7 +604,7 @@ page_rec_set_next(
must not be page infimum */
/************************************************************//**
Gets the pointer to the previous record.
-@return pointer to previous record */
+@return pointer to previous record */
UNIV_INLINE
const rec_t*
page_rec_get_prev_const(
@@ -613,7 +613,7 @@ page_rec_get_prev_const(
infimum */
/************************************************************//**
Gets the pointer to the previous record.
-@return pointer to previous record */
+@return pointer to previous record */
UNIV_INLINE
rec_t*
page_rec_get_prev(
@@ -622,7 +622,7 @@ page_rec_get_prev(
must not be page infimum */
/************************************************************//**
TRUE if the record is a user record on the page.
-@return TRUE if a user record */
+@return TRUE if a user record */
UNIV_INLINE
ibool
page_rec_is_user_rec_low(
@@ -631,7 +631,7 @@ page_rec_is_user_rec_low(
MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the supremum record on a page.
-@return TRUE if the supremum record */
+@return TRUE if the supremum record */
UNIV_INLINE
ibool
page_rec_is_supremum_low(
@@ -640,7 +640,7 @@ page_rec_is_supremum_low(
MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the infimum record on a page.
-@return TRUE if the infimum record */
+@return TRUE if the infimum record */
UNIV_INLINE
ibool
page_rec_is_infimum_low(
@@ -650,35 +650,80 @@ page_rec_is_infimum_low(
/************************************************************//**
TRUE if the record is a user record on the page.
-@return TRUE if a user record */
+@return TRUE if a user record */
UNIV_INLINE
ibool
page_rec_is_user_rec(
/*=================*/
const rec_t* rec) /*!< in: record */
- MY_ATTRIBUTE((const));
+ MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
TRUE if the record is the supremum record on a page.
-@return TRUE if the supremum record */
+@return TRUE if the supremum record */
UNIV_INLINE
ibool
page_rec_is_supremum(
/*=================*/
const rec_t* rec) /*!< in: record */
- MY_ATTRIBUTE((const));
+ MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
TRUE if the record is the infimum record on a page.
-@return TRUE if the infimum record */
+@return TRUE if the infimum record */
UNIV_INLINE
ibool
page_rec_is_infimum(
/*================*/
const rec_t* rec) /*!< in: record */
- MY_ATTRIBUTE((const));
+ MY_ATTRIBUTE((warn_unused_result));
+
+/************************************************************//**
+true if the record is the first user record on a page.
+@return true if the first user record */
+UNIV_INLINE
+bool
+page_rec_is_first(
+/*==============*/
+ const rec_t* rec, /*!< in: record */
+ const page_t* page) /*!< in: page */
+ MY_ATTRIBUTE((warn_unused_result));
+
+/************************************************************//**
+true if the record is the second user record on a page.
+@return true if the second user record */
+UNIV_INLINE
+bool
+page_rec_is_second(
+/*===============*/
+ const rec_t* rec, /*!< in: record */
+ const page_t* page) /*!< in: page */
+ MY_ATTRIBUTE((warn_unused_result));
+
+/************************************************************//**
+true if the record is the last user record on a page.
+@return true if the last user record */
+UNIV_INLINE
+bool
+page_rec_is_last(
+/*=============*/
+ const rec_t* rec, /*!< in: record */
+ const page_t* page) /*!< in: page */
+ MY_ATTRIBUTE((warn_unused_result));
+
+/************************************************************//**
+true if the record is the second last user record on a page.
+@return true if the second last user record */
+UNIV_INLINE
+bool
+page_rec_is_second_last(
+/*====================*/
+ const rec_t* rec, /*!< in: record */
+ const page_t* page) /*!< in: page */
+ MY_ATTRIBUTE((warn_unused_result));
+
/***************************************************************//**
Looks for the record which owns the given record.
-@return the owner record */
+@return the owner record */
UNIV_INLINE
rec_t*
page_rec_find_owner_rec(
@@ -700,7 +745,7 @@ page_rec_write_field(
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap.
-@return maximum combined size for inserted records */
+@return maximum combined size for inserted records */
UNIV_INLINE
ulint
page_get_max_insert_size(
@@ -710,7 +755,7 @@ page_get_max_insert_size(
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap if page is first reorganized.
-@return maximum combined size for inserted records */
+@return maximum combined size for inserted records */
UNIV_INLINE
ulint
page_get_max_insert_size_after_reorganize(
@@ -719,7 +764,7 @@ page_get_max_insert_size_after_reorganize(
ulint n_recs);/*!< in: number of records */
/*************************************************************//**
Calculates free space if a page is emptied.
-@return free space */
+@return free space */
UNIV_INLINE
ulint
page_get_free_space_of_empty(
@@ -729,7 +774,7 @@ page_get_free_space_of_empty(
/**********************************************************//**
Returns the base extra size of a physical record. This is the
size of the fixed header, independent of the record size.
-@return REC_N_NEW_EXTRA_BYTES or REC_N_OLD_EXTRA_BYTES */
+@return REC_N_NEW_EXTRA_BYTES or REC_N_OLD_EXTRA_BYTES */
UNIV_INLINE
ulint
page_rec_get_base_extra_size(
@@ -738,7 +783,7 @@ page_rec_get_base_extra_size(
/************************************************************//**
Returns the sum of the sizes of the records in the record list
excluding the infimum and supremum records.
-@return data in bytes */
+@return data in bytes */
UNIV_INLINE
ulint
page_get_data_size(
@@ -760,8 +805,7 @@ page_mem_alloc_free(
ulint need); /*!< in: number of bytes allocated */
/************************************************************//**
Allocates a block of memory from the heap of an index page.
-@return pointer to start of allocated buffer, or NULL if allocation fails */
-UNIV_INTERN
+@return pointer to start of allocated buffer, or NULL if allocation fails */
byte*
page_mem_alloc_heap(
/*================*/
@@ -789,32 +833,38 @@ page_mem_free(
rec_get_offsets() */
/**********************************************************//**
Create an uncompressed B-tree index page.
-@return pointer to the page */
-UNIV_INTERN
+@return pointer to the page */
page_t*
page_create(
/*========*/
buf_block_t* block, /*!< in: a buffer block where the
page is created */
mtr_t* mtr, /*!< in: mini-transaction handle */
- ulint comp); /*!< in: nonzero=compact page format */
+ ulint comp, /*!< in: nonzero=compact page format */
+ bool is_rtree); /*!< in: if creating R-tree page */
/**********************************************************//**
Create a compressed B-tree index page.
-@return pointer to the page */
-UNIV_INTERN
+@return pointer to the page */
page_t*
page_create_zip(
/*============*/
- buf_block_t* block, /*!< in/out: a buffer frame where the
- page is created */
- dict_index_t* index, /*!< in: the index of the page */
- ulint level, /*!< in: the B-tree level of the page */
- trx_id_t max_trx_id, /*!< in: PAGE_MAX_TRX_ID */
- mtr_t* mtr) /*!< in/out: mini-transaction */
- MY_ATTRIBUTE((nonnull));
+ buf_block_t* block, /*!< in/out: a buffer frame
+ where the page is created */
+ dict_index_t* index, /*!< in: the index of the
+ page, or NULL when applying
+ TRUNCATE log
+ record during recovery */
+ ulint level, /*!< in: the B-tree level of
+ the page */
+ trx_id_t max_trx_id, /*!< in: PAGE_MAX_TRX_ID */
+ const redo_page_compress_t* page_comp_info,
+ /*!< in: used for applying
+ TRUNCATE log
+ record during recovery */
+ mtr_t* mtr); /*!< in/out: mini-transaction
+ handle */
/**********************************************************//**
Empty a previously created B-tree index page. */
-UNIV_INTERN
void
page_create_empty(
/*==============*/
@@ -830,7 +880,6 @@ IMPORTANT: The caller will have to update IBUF_BITMAP_FREE
if new_block is a compressed leaf page in a secondary index.
This has to be done either within the same mini-transaction,
or by invoking ibuf_reset_free_bits() before mtr_commit(). */
-UNIV_INTERN
void
page_copy_rec_list_end_no_locks(
/*============================*/
@@ -851,7 +900,6 @@ or by invoking ibuf_reset_free_bits() before mtr_commit().
@return pointer to the original successor of the infimum record on
new_page, or NULL on zip overflow (new_block will be decompressed) */
-UNIV_INTERN
rec_t*
page_copy_rec_list_end(
/*===================*/
@@ -873,7 +921,6 @@ or by invoking ibuf_reset_free_bits() before mtr_commit().
@return pointer to the original predecessor of the supremum record on
new_page, or NULL on zip overflow (new_block will be decompressed) */
-UNIV_INTERN
rec_t*
page_copy_rec_list_start(
/*=====================*/
@@ -886,7 +933,6 @@ page_copy_rec_list_start(
/*************************************************************//**
Deletes records from a page from a given record onward, including that record.
The infimum and supremum records are not deleted. */
-UNIV_INTERN
void
page_delete_rec_list_end(
/*=====================*/
@@ -903,7 +949,6 @@ page_delete_rec_list_end(
/*************************************************************//**
Deletes records from page, up to the given record, NOT including
that record. Infimum and supremum records are not deleted. */
-UNIV_INTERN
void
page_delete_rec_list_start(
/*=======================*/
@@ -923,7 +968,6 @@ or by invoking ibuf_reset_free_bits() before mtr_commit().
@return TRUE on success; FALSE on compression failure (new_block will
be decompressed) */
-UNIV_INTERN
ibool
page_move_rec_list_end(
/*===================*/
@@ -942,8 +986,7 @@ if new_block is a compressed leaf page in a secondary index.
This has to be done either within the same mini-transaction,
or by invoking ibuf_reset_free_bits() before mtr_commit().
-@return TRUE on success; FALSE on compression failure */
-UNIV_INTERN
+@return TRUE on success; FALSE on compression failure */
ibool
page_move_rec_list_start(
/*=====================*/
@@ -955,7 +998,6 @@ page_move_rec_list_start(
MY_ATTRIBUTE((nonnull(1, 2, 4, 5)));
/****************************************************************//**
Splits a directory slot which owns too many records. */
-UNIV_INTERN
void
page_dir_split_slot(
/*================*/
@@ -969,7 +1011,6 @@ 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. */
-UNIV_INTERN
void
page_dir_balance_slot(
/*==================*/
@@ -979,12 +1020,11 @@ page_dir_balance_slot(
MY_ATTRIBUTE((nonnull(1)));
/**********************************************************//**
Parses a log record of a record list end or start deletion.
-@return end of log record or NULL */
-UNIV_INTERN
+@return end of log record or NULL */
byte*
page_parse_delete_rec_list(
/*=======================*/
- byte type, /*!< in: MLOG_LIST_END_DELETE,
+ mlog_id_t type, /*!< in: MLOG_LIST_END_DELETE,
MLOG_LIST_START_DELETE,
MLOG_COMP_LIST_END_DELETE or
MLOG_COMP_LIST_START_DELETE */
@@ -993,23 +1033,19 @@ page_parse_delete_rec_list(
buf_block_t* block, /*!< in/out: buffer block or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr); /*!< in: mtr or NULL */
-/***********************************************************//**
-Parses a redo log record of creating a page.
-@return end of log record or NULL */
-UNIV_INTERN
-byte*
+/** Parses a redo log record of creating a page.
+@param[in,out] block buffer block, or NULL
+@param[in] comp nonzero=compact page format
+@param[in] is_rtree whether it is rtree page */
+void
page_parse_create(
-/*==============*/
- byte* ptr, /*!< in: buffer */
- byte* end_ptr,/*!< in: buffer end */
- ulint comp, /*!< in: nonzero=compact page format */
- buf_block_t* block, /*!< in: block or NULL */
- mtr_t* mtr); /*!< in: mtr or NULL */
+ buf_block_t* block,
+ ulint comp,
+ bool is_rtree);
#ifndef UNIV_HOTBACKUP
/************************************************************//**
Prints record contents including the data relevant only in
the index page context. */
-UNIV_INTERN
void
page_rec_print(
/*===========*/
@@ -1019,7 +1055,6 @@ page_rec_print(
/***************************************************************//**
This is used to print the contents of the directory for
debugging purposes. */
-UNIV_INTERN
void
page_dir_print(
/*===========*/
@@ -1028,7 +1063,6 @@ page_dir_print(
/***************************************************************//**
This is used to print the contents of the page record list for
debugging purposes. */
-UNIV_INTERN
void
page_print_list(
/*============*/
@@ -1037,7 +1071,6 @@ page_print_list(
ulint pr_n); /*!< in: print n first and n last entries */
/***************************************************************//**
Prints the info in a page header. */
-UNIV_INTERN
void
page_header_print(
/*==============*/
@@ -1045,7 +1078,6 @@ page_header_print(
/***************************************************************//**
This is used to print the contents of the page for
debugging purposes. */
-UNIV_INTERN
void
page_print(
/*=======*/
@@ -1061,28 +1093,27 @@ page_print(
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.
-@return TRUE if ok */
-UNIV_INTERN
+@return TRUE if ok */
ibool
page_rec_validate(
/*==============*/
const rec_t* rec, /*!< in: physical record */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+#ifdef UNIV_DEBUG
/***************************************************************//**
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. */
-UNIV_INTERN
void
page_check_dir(
/*===========*/
const page_t* page); /*!< in: index page */
+#endif /* UNIV_DEBUG */
/***************************************************************//**
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.
-@return TRUE if ok */
-UNIV_INTERN
+@return TRUE if ok */
ibool
page_simple_validate_old(
/*=====================*/
@@ -1091,16 +1122,14 @@ page_simple_validate_old(
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.
-@return TRUE if ok */
-UNIV_INTERN
+@return TRUE if ok */
ibool
page_simple_validate_new(
/*=====================*/
const page_t* page); /*!< in: index page in ROW_FORMAT!=REDUNDANT */
/***************************************************************//**
This function checks the consistency of an index page.
-@return TRUE if ok */
-UNIV_INTERN
+@return TRUE if ok */
ibool
page_validate(
/*==========*/
@@ -1109,8 +1138,7 @@ page_validate(
the page record type definition */
/***************************************************************//**
Looks in the page record list for a record with the given heap number.
-@return record, NULL if not found */
-
+@return record, NULL if not found */
const rec_t*
page_find_rec_with_heap_no(
/*=======================*/
@@ -1120,7 +1148,6 @@ page_find_rec_with_heap_no(
@param[in] page index tree leaf page
@return the last record, not delete-marked
@retval infimum record if all records are delete-marked */
-
const rec_t*
page_find_rec_max_not_deleted(
const page_t* page);
@@ -1129,14 +1156,12 @@ page_find_rec_max_not_deleted(
but different than the global setting innodb_checksum_algorithm.
@param[in] current_algo current checksum algorithm
@param[in] page_checksum page valid checksum
-@param[in] space_id tablespace id
-@param[in] page_no page number */
+@param[in] page_id page identifier */
void
page_warn_strict_checksum(
srv_checksum_algorithm_t curr_algo,
srv_checksum_algorithm_t page_checksum,
- ulint space_id,
- ulint page_no);
+ const page_id_t& page_id);
#ifdef UNIV_MATERIALIZE
#undef UNIV_INLINE