MySQL 8.0.40
Source Code Documentation
fil0types.h File Reference

The low-level file system page header & trailer offsets. More...

#include "univ.i"

Go to the source code of this file.

Classes

struct  Fil_page_header
 A wrapper class to help print and inspect the file page header. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const Fil_page_header &header) noexcept
 Overload the global output operator to handle an object of type Fil_page_header. More...
 

Variables

constexpr uint32_t FIL_PAGE_SPACE_OR_CHKSUM = 0
 The byte offsets on a file page for various variables. More...
 
constexpr uint32_t FIL_PAGE_OFFSET = 4
 page offset inside space More...
 
constexpr uint32_t FIL_PAGE_PREV = 8
 if there is a 'natural' predecessor of the page, its offset. More...
 
constexpr uint32_t FIL_PAGE_SRV_VERSION = 8
 On page 0 of the tablespace, this is the server version ID. More...
 
constexpr uint32_t FIL_PAGE_NEXT = 12
 if there is a 'natural' successor of the page, its offset. More...
 
constexpr uint32_t FIL_PAGE_SPACE_VERSION = 12
 On page 0 of the tablespace, this is the server version ID. More...
 
constexpr uint32_t FIL_PAGE_LSN = 16
 lsn of the end of the newest modification log record to the page More...
 
constexpr uint32_t FIL_PAGE_TYPE = 24
 file page type: FIL_PAGE_INDEX,..., 2 bytes. More...
 
constexpr uint32_t FIL_PAGE_FILE_FLUSH_LSN = 26
 this is only defined for the first page of the system tablespace: the file has been flushed to disk at least up to this LSN. More...
 
constexpr uint32_t FIL_PAGE_VERSION = FIL_PAGE_FILE_FLUSH_LSN
 If page type is FIL_PAGE_COMPRESSED then the 8 bytes starting at FIL_PAGE_FILE_FLUSH_LSN are broken down as follows: More...
 
constexpr uint32_t FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1
 Compression algorithm (u8) More...
 
constexpr uint32_t FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1
 Original page type (u16) More...
 
constexpr uint32_t FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2
 Original data size in bytes (u16) More...
 
constexpr uint32_t FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2
 Size after compression (u16) More...
 
constexpr uint32_t FIL_RTREE_SPLIT_SEQ_NUM = FIL_PAGE_FILE_FLUSH_LSN
 This overloads FIL_PAGE_FILE_FLUSH_LSN for RTREE Split Sequence Number. More...
 
constexpr uint32_t FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID = 34
 starting from 4.1.x this contains the space id of the page More...
 
constexpr uint32_t FIL_PAGE_SPACE_ID = FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
 alias for space id More...
 
constexpr uint32_t FIL_PAGE_DATA = 38
 start of the data on the page More...
 
constexpr uint32_t FIL_PAGE_END_LSN_OLD_CHKSUM = 8
 File page trailer. More...
 
constexpr uint32_t FIL_PAGE_DATA_END = 8
 size of the page trailer More...
 
constexpr size_t FIL_ADDR_PAGE = 0
 First in address is the page offset. More...
 
constexpr size_t FIL_ADDR_BYTE = 4
 Then comes 2-byte byte offset within page. More...
 
constexpr size_t FIL_ADDR_SIZE = 6
 Address size is 6 bytes. More...
 
constexpr char FIL_PATH_SEPARATOR = ';'
 Path separator e.g., 'dir;...;dirN'. More...
 

Detailed Description

The low-level file system page header & trailer offsets.

Created 10/25/1995 Heikki Tuuri

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const Fil_page_header header 
)
inlinenoexcept

Overload the global output operator to handle an object of type Fil_page_header.

Parameters
[in]outthe output stream.
[in]headeran object of type Fil_page_header.
Returns
the output stream.

Variable Documentation

◆ FIL_ADDR_BYTE

constexpr size_t FIL_ADDR_BYTE = 4
constexpr

Then comes 2-byte byte offset within page.

◆ FIL_ADDR_PAGE

constexpr size_t FIL_ADDR_PAGE = 0
constexpr

First in address is the page offset.

◆ FIL_ADDR_SIZE

constexpr size_t FIL_ADDR_SIZE = 6
constexpr

Address size is 6 bytes.

◆ FIL_PAGE_ALGORITHM_V1

constexpr uint32_t FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1
constexpr

Compression algorithm (u8)

◆ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID

constexpr uint32_t FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID = 34
constexpr

starting from 4.1.x this contains the space id of the page

◆ FIL_PAGE_COMPRESS_SIZE_V1

constexpr uint32_t FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2
constexpr

Size after compression (u16)

◆ FIL_PAGE_DATA

constexpr uint32_t FIL_PAGE_DATA = 38
constexpr

start of the data on the page

◆ FIL_PAGE_DATA_END

constexpr uint32_t FIL_PAGE_DATA_END = 8
constexpr

size of the page trailer

◆ FIL_PAGE_END_LSN_OLD_CHKSUM

constexpr uint32_t FIL_PAGE_END_LSN_OLD_CHKSUM = 8
constexpr

File page trailer.

the low 4 bytes of this are used to store the page checksum, the last 4 bytes should be identical to the last 4 bytes of FIL_PAGE_LSN

◆ FIL_PAGE_FILE_FLUSH_LSN

constexpr uint32_t FIL_PAGE_FILE_FLUSH_LSN = 26
constexpr

this is only defined for the first page of the system tablespace: the file has been flushed to disk at least up to this LSN.

For FIL_PAGE_COMPRESSED pages, we store the compressed page control information in these 8 bytes.

◆ FIL_PAGE_LSN

constexpr uint32_t FIL_PAGE_LSN = 16
constexpr

lsn of the end of the newest modification log record to the page

◆ FIL_PAGE_NEXT

constexpr uint32_t FIL_PAGE_NEXT = 12
constexpr

if there is a 'natural' successor of the page, its offset.

Otherwise FIL_NULL. B-tree index pages(FIL_PAGE_TYPE contains FIL_PAGE_INDEX) on the same PAGE_LEVEL are maintained as a doubly linked list via FIL_PAGE_PREV and FIL_PAGE_NEXT in the collation order of the smallest user record on each page.

◆ FIL_PAGE_OFFSET

constexpr uint32_t FIL_PAGE_OFFSET = 4
constexpr

page offset inside space

◆ FIL_PAGE_ORIGINAL_SIZE_V1

constexpr uint32_t FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2
constexpr

Original data size in bytes (u16)

◆ FIL_PAGE_ORIGINAL_TYPE_V1

constexpr uint32_t FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1
constexpr

Original page type (u16)

◆ FIL_PAGE_PREV

constexpr uint32_t FIL_PAGE_PREV = 8
constexpr

if there is a 'natural' predecessor of the page, its offset.

Otherwise FIL_NULL. This field is not set on BLOB pages, which are stored as a singly-linked list. See also FIL_PAGE_NEXT.

◆ FIL_PAGE_SPACE_ID

constexpr uint32_t FIL_PAGE_SPACE_ID = FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
constexpr

alias for space id

◆ FIL_PAGE_SPACE_OR_CHKSUM

constexpr uint32_t FIL_PAGE_SPACE_OR_CHKSUM = 0
constexpr

The byte offsets on a file page for various variables.

MySQL-4.0.14 space id the page belongs to (== 0) but in later versions the 'new' checksum of the page

◆ FIL_PAGE_SPACE_VERSION

constexpr uint32_t FIL_PAGE_SPACE_VERSION = 12
constexpr

On page 0 of the tablespace, this is the server version ID.

◆ FIL_PAGE_SRV_VERSION

constexpr uint32_t FIL_PAGE_SRV_VERSION = 8
constexpr

On page 0 of the tablespace, this is the server version ID.

◆ FIL_PAGE_TYPE

constexpr uint32_t FIL_PAGE_TYPE = 24
constexpr

file page type: FIL_PAGE_INDEX,..., 2 bytes.

The contents of this field can only be trusted in the following case: if the page is an uncompressed B-tree index page, then it is guaranteed that the value is FIL_PAGE_INDEX. The opposite does not hold.

In tablespaces created by MySQL/InnoDB 5.1.7 or later, the contents of this field is valid for all uncompressed pages.

◆ FIL_PAGE_VERSION

constexpr uint32_t FIL_PAGE_VERSION = FIL_PAGE_FILE_FLUSH_LSN
constexpr

If page type is FIL_PAGE_COMPRESSED then the 8 bytes starting at FIL_PAGE_FILE_FLUSH_LSN are broken down as follows:

Control information version format (u8)

◆ FIL_PATH_SEPARATOR

constexpr char FIL_PATH_SEPARATOR = ';'
constexpr

Path separator e.g., 'dir;...;dirN'.

◆ FIL_RTREE_SPLIT_SEQ_NUM

constexpr uint32_t FIL_RTREE_SPLIT_SEQ_NUM = FIL_PAGE_FILE_FLUSH_LSN
constexpr

This overloads FIL_PAGE_FILE_FLUSH_LSN for RTREE Split Sequence Number.