MySQL  8.0.22
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.

Macros

#define FIL_PAGE_SPACE_OR_CHKSUM   0
 The byte offsets on a file page for various variables. More...
 
#define FIL_PAGE_OFFSET   4
 page offset inside space More...
 
#define FIL_PAGE_PREV   8
 if there is a 'natural' predecessor of the page, its offset. More...
 
#define FIL_PAGE_SRV_VERSION   8
 On page 0 of the tablespace, this is the server version ID. More...
 
#define FIL_PAGE_NEXT   12
 if there is a 'natural' successor of the page, its offset. More...
 
#define FIL_PAGE_SPACE_VERSION   12
 On page 0 of the tablespace, this is the server version ID. More...
 
#define FIL_PAGE_LSN   16
 lsn of the end of the newest modification log record to the page More...
 
#define FIL_PAGE_TYPE   24
 file page type: FIL_PAGE_INDEX,..., 2 bytes. More...
 
#define 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...
 
#define FIL_PAGE_SPACE_ID   FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
 alias for space id More...
 

Variables

constexpr ulint 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 ulint FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1
 Compression algorithm (u8) More...
 
constexpr ulint FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1
 Original page type (u16) More...
 
constexpr ulint FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2
 Original data size in bytes (u16) More...
 
constexpr ulint FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2
 Size after compression (u16) More...
 
constexpr ulint FIL_RTREE_SPLIT_SEQ_NUM = FIL_PAGE_FILE_FLUSH_LSN
 This overloads FIL_PAGE_FILE_FLUSH_LSN for RTREE Split Sequence Number. More...
 
constexpr ulint FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID = 34
 starting from 4.1.x this contains the space id of the page More...
 
constexpr ulint FIL_PAGE_DATA = 38
 start of the data on the page More...
 
constexpr ulint FIL_PAGE_END_LSN_OLD_CHKSUM = 8
 File page trailer. More...
 
constexpr ulint 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

Macro Definition Documentation

◆ FIL_PAGE_FILE_FLUSH_LSN

#define 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.

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

◆ FIL_PAGE_LSN

#define FIL_PAGE_LSN   16

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

◆ FIL_PAGE_NEXT

#define FIL_PAGE_NEXT   12

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

#define FIL_PAGE_OFFSET   4

page offset inside space

◆ FIL_PAGE_PREV

#define FIL_PAGE_PREV   8

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

#define FIL_PAGE_SPACE_ID   FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID

alias for space id

◆ FIL_PAGE_SPACE_OR_CHKSUM

#define FIL_PAGE_SPACE_OR_CHKSUM   0

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

#define FIL_PAGE_SPACE_VERSION   12

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

◆ FIL_PAGE_SRV_VERSION

#define FIL_PAGE_SRV_VERSION   8

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

◆ FIL_PAGE_TYPE

#define FIL_PAGE_TYPE   24

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.

Variable Documentation

◆ FIL_ADDR_BYTE

constexpr size_t FIL_ADDR_BYTE = 4

Then comes 2-byte byte offset within page.

◆ FIL_ADDR_PAGE

constexpr size_t FIL_ADDR_PAGE = 0

First in address is the page offset.

◆ FIL_ADDR_SIZE

constexpr size_t FIL_ADDR_SIZE = 6

Address size is 6 bytes.

◆ FIL_PAGE_ALGORITHM_V1

constexpr ulint FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1

Compression algorithm (u8)

◆ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID

constexpr ulint FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID = 34

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

◆ FIL_PAGE_COMPRESS_SIZE_V1

constexpr ulint FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2

Size after compression (u16)

◆ FIL_PAGE_DATA

constexpr ulint FIL_PAGE_DATA = 38

start of the data on the page

◆ FIL_PAGE_DATA_END

constexpr ulint FIL_PAGE_DATA_END = 8

size of the page trailer

◆ FIL_PAGE_END_LSN_OLD_CHKSUM

constexpr ulint FIL_PAGE_END_LSN_OLD_CHKSUM = 8

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_ORIGINAL_SIZE_V1

constexpr ulint FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2

Original data size in bytes (u16)

◆ FIL_PAGE_ORIGINAL_TYPE_V1

constexpr ulint FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1

Original page type (u16)

◆ FIL_PAGE_VERSION

constexpr ulint 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:

Control information version format (u8)

◆ FIL_PATH_SEPARATOR

constexpr char FIL_PATH_SEPARATOR = ';'

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

◆ FIL_RTREE_SPLIT_SEQ_NUM

constexpr ulint FIL_RTREE_SPLIT_SEQ_NUM = FIL_PAGE_FILE_FLUSH_LSN

This overloads FIL_PAGE_FILE_FLUSH_LSN for RTREE Split Sequence Number.