MySQL 8.0.39
Source Code Documentation
lob::data_page_t Struct Reference

The LOB data page carrying the user data. More...

#include <lob0pages.h>

Inheritance diagram for lob::data_page_t:
[legend]

Public Member Functions

 data_page_t ()=default
 
 data_page_t (buf_block_t *block, mtr_t *mtr)
 Constructor. More...
 
 data_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index)
 
 data_page_t (mtr_t *mtr, dict_index_t *index)
 
 data_page_t (buf_block_t *block)
 Constructor. More...
 
buf_block_talloc (mtr_t *alloc_mtr, bool is_bulk)
 Allocate a LOB data page. More...
 
buf_block_tload_x (page_no_t page_no)
 
void set_version_0 ()
 
void dealloc ()
 
void set_page_type ()
 
void set_trx_id (trx_id_t id)
 
void set_trx_id_no_redo (trx_id_t id)
 Write the trx identifier to the header, without generating redo log. More...
 
bytedata_begin () const
 
buf_block_treplace (trx_t *trx, ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
 Create a new data page and replace some or all parts of the old data with data. More...
 
void replace_inline (ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
 Replace some or all parts of the data inline. More...
 
ulint get_data_len () const
 
void set_data_len (ulint len)
 
ulint read (ulint offset, byte *ptr, ulint want)
 Read data from the data page. More...
 
ulint write (const byte *&data, ulint &len)
 Write data into a data page. More...
 
ulint append (trx_id_t trxid, byte *&data, ulint &len)
 Append given data in data page. More...
 
std::pair< ulint, byte * > insert_middle (trx_t *trx, ulint offset, byte *&data, ulint &len, buf_block_t *&new_block)
 
buf_block_tremove_middle (trx_t *trx, ulint offset, ulint &len)
 
ulint max_space_available () const
 
ulint space_left () const
 
- Public Member Functions inherited from lob::basic_page_t
 basic_page_t ()
 
 basic_page_t (buf_block_t *block, mtr_t *mtr)
 
 basic_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index)
 
void set_space_id_no_redo (space_id_t space_id)
 Update the space identifier to given value without generating any redo log records. More...
 
page_no_t get_page_no () const
 Get page number of the current page. More...
 
page_id_t get_page_id () const
 Get the page id of the current page. More...
 
void set_next_page (page_no_t page_no, mtr_t *mtr)
 Set the FIL_PAGE_NEXT to the given page number, using the given mini transaction context. More...
 
void set_next_page (page_no_t page_no)
 Set the FIL_PAGE_NEXT to the given page number. More...
 
void set_next_page_null ()
 Set the FIL_PAGE_NEXT to FIL_NULL. More...
 
page_no_t get_next_page ()
 
page_type_t get_page_type () const
 
byteframe () const
 
flst_node_tget_flst_node (const fil_addr_t &addr)
 
ulint max_space_available ()
 
buf_block_tget_block () const noexcept
 Get the underlying buffer block. More...
 
void set_block (buf_block_t *block)
 
void set_mtr (mtr_t *mtr)
 

Static Public Member Functions

static ulint payload ()
 
- Static Public Member Functions inherited from lob::basic_page_t
static ulint payload ()
 

Static Public Attributes

static const ulint OFFSET_VERSION = FIL_PAGE_DATA
 
static const ulint OFFSET_DATA_LEN = OFFSET_VERSION + 1
 
static const ulint OFFSET_TRX_ID = OFFSET_DATA_LEN + 4
 
static const ulint LOB_PAGE_DATA = OFFSET_TRX_ID + 6
 

Additional Inherited Members

- Protected Attributes inherited from lob::basic_page_t
buf_block_tm_block
 
mtr_tm_mtr
 
dict_index_tm_index
 

Detailed Description

The LOB data page carrying the user data.

Constructor & Destructor Documentation

◆ data_page_t() [1/5]

lob::data_page_t::data_page_t ( )
default

◆ data_page_t() [2/5]

lob::data_page_t::data_page_t ( buf_block_t block,
mtr_t mtr 
)
inline

Constructor.

◆ data_page_t() [3/5]

lob::data_page_t::data_page_t ( buf_block_t block,
mtr_t mtr,
dict_index_t index 
)
inline

◆ data_page_t() [4/5]

lob::data_page_t::data_page_t ( mtr_t mtr,
dict_index_t index 
)
inline

◆ data_page_t() [5/5]

lob::data_page_t::data_page_t ( buf_block_t block)
inline

Constructor.

Parameters
[in]blockthe buffer block.

Member Function Documentation

◆ alloc()

buf_block_t * lob::data_page_t::alloc ( mtr_t alloc_mtr,
bool  is_bulk 
)

Allocate a LOB data page.

Parameters
[in]alloc_mtrMini-transaction to be used for allocation of LOB page.
[in]is_bulktrue if bulk operation.
Returns
allocated buffer block or nullptr

◆ append()

ulint lob::data_page_t::append ( trx_id_t  trxid,
byte *&  data,
ulint len 
)

Append given data in data page.

Parameters
[in]trxidtransaction doing append.
[in,out]datadata to be appended.
[in,out]lenlength of data.
Returns
number of bytes appended.

◆ data_begin()

byte * lob::data_page_t::data_begin ( ) const
inline

◆ dealloc()

void lob::data_page_t::dealloc ( )
inline

◆ get_data_len()

ulint lob::data_page_t::get_data_len ( ) const
inline

◆ insert_middle()

std::pair< ulint, byte * > lob::data_page_t::insert_middle ( trx_t trx,
ulint  offset,
byte *&  data,
ulint len,
buf_block_t *&  new_block 
)

◆ load_x()

buf_block_t * lob::data_page_t::load_x ( page_no_t  page_no)

◆ max_space_available()

ulint lob::data_page_t::max_space_available ( ) const
inline

◆ payload()

static ulint lob::data_page_t::payload ( )
inlinestatic

◆ read()

ulint lob::data_page_t::read ( ulint  offset,
byte ptr,
ulint  want 
)

Read data from the data page.

Parameters
[in]offsetread begins at this offset.
[out]ptrthe output buffer.
[in]wantbytes to read
Returns
bytes actually read.

◆ remove_middle()

buf_block_t * lob::data_page_t::remove_middle ( trx_t trx,
ulint  offset,
ulint len 
)

◆ replace()

buf_block_t * lob::data_page_t::replace ( trx_t trx,
ulint  offset,
const byte *&  ptr,
ulint want,
mtr_t mtr 
)

Create a new data page and replace some or all parts of the old data with data.

Parameters
[in]trxCurrent transaction.
[in]offsetOffset where replace begins.
[in,out]ptrPointer to new data.
[in]wantAmount of data the caller wants to replace.
[in]mtrMini-transaction context.
Returns
the buffer block of the new data page.

Allocate a new data page.

Copy contents from old page to new page.

Copy the new data to new page.

Copy contents from old page to new page.

◆ replace_inline()

void lob::data_page_t::replace_inline ( ulint  offset,
const byte *&  ptr,
ulint want,
mtr_t mtr 
)

Replace some or all parts of the data inline.

Parameters
[in]offsetOffset where replace begins.
[in,out]ptrPointer to new data.
[in]wantAmount of data the caller wants to replace.
[in]mtrMini-transaction context.

Copy the new data to page.

◆ set_data_len()

void lob::data_page_t::set_data_len ( ulint  len)
inline

◆ set_page_type()

void lob::data_page_t::set_page_type ( )
inline

◆ set_trx_id()

void lob::data_page_t::set_trx_id ( trx_id_t  id)
inline

◆ set_trx_id_no_redo()

void lob::data_page_t::set_trx_id_no_redo ( trx_id_t  id)
inline

Write the trx identifier to the header, without generating redo log.

Parameters
[in]idthe transaction identifier.

◆ set_version_0()

void lob::data_page_t::set_version_0 ( )
inline

◆ space_left()

ulint lob::data_page_t::space_left ( ) const

◆ write()

ulint lob::data_page_t::write ( const byte *&  data,
ulint len 
)

Write data into a data page.

Parameters
[in,out]datathe data to be written. it will be updated to point to the byte not yet written.
[in,out]lenlength of data to be written.
Returns
amount of data actually written into the page.

Member Data Documentation

◆ LOB_PAGE_DATA

const ulint lob::data_page_t::LOB_PAGE_DATA = OFFSET_TRX_ID + 6
static

◆ OFFSET_DATA_LEN

const ulint lob::data_page_t::OFFSET_DATA_LEN = OFFSET_VERSION + 1
static

◆ OFFSET_TRX_ID

const ulint lob::data_page_t::OFFSET_TRX_ID = OFFSET_DATA_LEN + 4
static

◆ OFFSET_VERSION

const ulint lob::data_page_t::OFFSET_VERSION = FIL_PAGE_DATA
static

The documentation for this struct was generated from the following files: