MySQL 9.0.0
Source Code Documentation
lob::index_entry_t Struct Reference

An index entry pointing to an LOB page. More...

#include <lob0index.h>

Inheritance diagram for lob::index_entry_t:
[legend]

Public Member Functions

 index_entry_t (flst_node_t *node)
 Constructor. More...
 
 index_entry_t (flst_node_t *node, mtr_t *mtr)
 
 index_entry_t (flst_node_t *node, mtr_t *mtr, dict_index_t *index)
 
 index_entry_t (mtr_t *mtr, const dict_index_t *index)
 
void reset (fil_addr_t &addr)
 
buf_block_tget_block () const
 
void reset (flst_node_t *node)
 
bool is_null () const
 
void init ()
 Initialize the object fully. More...
 
fil_addr_t get_self () const
 Get the location of the current index entry. More...
 
void set_versions_null ()
 The versions base node is set to NULL. More...
 
bool can_rollback (trx_id_t trxid, undo_no_t undo_no)
 Determine if the current index entry be rolled back. More...
 
bool can_be_purged (trx_id_t trxid, undo_no_t undo_no)
 Determine if the current index entry be purged. More...
 
void set_old_version (index_entry_t &entry)
 
fil_addr_t make_old_version_current (dict_index_t *index, first_page_t &first_page)
 The current index entry points to a latest LOB page. More...
 
fil_addr_t purge_version (dict_index_t *index, flst_base_node_t *lst, flst_base_node_t *free_list)
 Purge the current entry. More...
 
void add_version (index_entry_t &entry) const
 
flst_base_node_tget_versions_list () const
 
void push_back (flst_base_node_t *bnode)
 Add this node as the last node in the given list. More...
 
flst_bnode_t get_versions_mem () const
 Get the base node of the list of versions. More...
 
trx_id_t get_trx_id () const
 
trx_id_t get_trx_id_modifier () const
 
undo_no_t get_trx_undo_no () const
 
uint32_t get_lob_version () const
 
undo_no_t get_trx_undo_no_modifier () const
 Get the undo number of the modifier trx. More...
 
fil_addr_t get_next () const
 
buf_block_tnext ()
 Make the current index entry object to point to the next index entry object. More...
 
fil_addr_t get_prev () const
 Get the previous index entry. More...
 
void set_trx_id_no_redo (trx_id_t id)
 Write the trx identifier to the index entry. More...
 
void set_trx_id_modifier_no_redo (trx_id_t id)
 Write the modifier trx identifier to the index entry. More...
 
void set_trx_id (trx_id_t id)
 
void set_trx_id_modifier (trx_id_t id)
 
void set_trx_undo_no (undo_no_t undo_no)
 
void set_lob_version (uint32_t version)
 Set the LOB version of this entry. More...
 
void set_trx_undo_no_modifier (undo_no_t undo_no)
 
void set_page_no (page_no_t num)
 
void set_prev_null ()
 
void set_next_null ()
 
page_no_t get_page_no () const
 
void set_data_len (ulint len)
 
ulint get_data_len () const
 
std::ostream & print (std::ostream &out) const
 
bool is_same (const index_entry_t &that)
 
void read (index_entry_mem_t &entry_mem) const
 
buf_block_tload_x (const fil_addr_t &addr)
 Load the index entry available in the given file address. More...
 
buf_block_tload_s (const fil_addr_t &addr)
 Load the index entry available in the given file address. More...
 
void insert_after (flst_base_node_t *base, index_entry_t &entry)
 
void insert_before (flst_base_node_t *base, index_entry_t &entry)
 
void remove (flst_base_node_t *bnode)
 
void free_data_page (const page_no_t first_page_no)
 Free the data page pointed to by this index entry. More...
 

Static Public Attributes

static const ulint OFFSET_PREV = 0
 Index entry offsets within node. More...
 
static const ulint OFFSET_NEXT = OFFSET_PREV + FIL_ADDR_SIZE
 
static const ulint OFFSET_VERSIONS = OFFSET_NEXT + FIL_ADDR_SIZE
 Points to base node of the list of versions. More...
 
static const ulint OFFSET_TRXID = OFFSET_VERSIONS + FLST_BASE_NODE_SIZE
 The creator trx id. More...
 
static const ulint OFFSET_TRXID_MODIFIER = OFFSET_TRXID + 6
 The modifier trx id. More...
 
static const ulint OFFSET_TRX_UNDO_NO = OFFSET_TRXID_MODIFIER + 6
 
static const ulint OFFSET_TRX_UNDO_NO_MODIFIER = OFFSET_TRX_UNDO_NO + 4
 The undo number of the modifier trx. More...
 
static const ulint OFFSET_PAGE_NO = OFFSET_TRX_UNDO_NO_MODIFIER + 4
 
static const ulint OFFSET_DATA_LEN = OFFSET_PAGE_NO + 4
 
static const ulint OFFSET_LOB_VERSION = OFFSET_DATA_LEN + 4
 The LOB version number. More...
 
static const ulint SIZE = OFFSET_LOB_VERSION + 4
 Total length of an index node. More...
 

Protected Member Functions

byteget_versions_ptr () const
 Get pointer to the base node of the list of versions. More...
 
byteget_datalen_ptr () const
 Get the location where data length is stored. More...
 
byteget_trxid_ptr () const
 Get pointer to the location where the creator trx id is written. More...
 
byteget_trxid_modifier_ptr () const
 Get pointer to the location where the modifier trx id is written. More...
 
byteget_pageno_ptr () const
 Get pointer to location where page number is written. More...
 
byteget_trx_undo_no_ptr () const
 Get pointer to location where undo number of creator trx is written. More...
 
byteget_trx_undo_no_modifier_ptr () const
 Get pointer to location where undo number of modifier trx is written. More...
 

Protected Attributes

bytem_node {nullptr}
 Pointer to the blob index entry node. More...
 

Private Member Functions

void move_version_base_node (index_entry_t &to_entry)
 Move the version base node from current entry to the given entry. More...
 
void purge (dict_index_t *index)
 Purge the current index entry. More...
 
byteget_lob_version_ptr () const
 
byteget_node_ptr () const
 
byteget_node () const
 

Private Attributes

mtr_tm_mtr
 
const dict_index_tm_index
 
buf_block_tm_block
 

Detailed Description

An index entry pointing to an LOB page.

Constructor & Destructor Documentation

◆ index_entry_t() [1/4]

lob::index_entry_t::index_entry_t ( flst_node_t node)
inline

Constructor.

Parameters
[in]nodethe pointer where index entry is located.

◆ index_entry_t() [2/4]

lob::index_entry_t::index_entry_t ( flst_node_t node,
mtr_t mtr 
)
inline

◆ index_entry_t() [3/4]

lob::index_entry_t::index_entry_t ( flst_node_t node,
mtr_t mtr,
dict_index_t index 
)
inline

◆ index_entry_t() [4/4]

lob::index_entry_t::index_entry_t ( mtr_t mtr,
const dict_index_t index 
)
inline

Member Function Documentation

◆ add_version()

void lob::index_entry_t::add_version ( index_entry_t entry) const
inline

◆ can_be_purged()

bool lob::index_entry_t::can_be_purged ( trx_id_t  trxid,
undo_no_t  undo_no 
)
inline

Determine if the current index entry be purged.

Parameters
[in]trxidthe transaction that is being purged.
[in]undo_nothe undo number of trx.
Returns
true if this entry can be purged, false otherwise.

◆ can_rollback()

bool lob::index_entry_t::can_rollback ( trx_id_t  trxid,
undo_no_t  undo_no 
)
inline

Determine if the current index entry be rolled back.

Parameters
[in]trxidthe transaction that is being purged.
[in]undo_nothe undo number of trx.
Returns
true if this entry can be rolled back, false otherwise.

◆ free_data_page()

void lob::index_entry_t::free_data_page ( const page_no_t  first_page_no)

Free the data page pointed to by this index entry.

The data page is available at offset OFFSET_PAGE_NO. After the page is freed, mark it as FIL_NULL. No other fields are modified. If the index entry points to the first page number of the LOB or if it is FIL_NULL, then this function is a no-op.

Parameters
[in]first_page_nothe first page number of the LOB.

◆ get_block()

buf_block_t * lob::index_entry_t::get_block ( ) const
inline

◆ get_data_len()

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

◆ get_datalen_ptr()

byte * lob::index_entry_t::get_datalen_ptr ( ) const
inlineprotected

Get the location where data length is stored.

Returns
the location where data length is stored.

◆ get_lob_version()

uint32_t lob::index_entry_t::get_lob_version ( ) const
inline

◆ get_lob_version_ptr()

byte * lob::index_entry_t::get_lob_version_ptr ( ) const
inlineprivate

◆ get_next()

fil_addr_t lob::index_entry_t::get_next ( ) const
inline

◆ get_node()

byte * lob::index_entry_t::get_node ( ) const
inlineprivate

◆ get_node_ptr()

byte * lob::index_entry_t::get_node_ptr ( ) const
inlineprivate

◆ get_page_no()

page_no_t lob::index_entry_t::get_page_no ( ) const
inline

◆ get_pageno_ptr()

byte * lob::index_entry_t::get_pageno_ptr ( ) const
inlineprotected

Get pointer to location where page number is written.

This page contains the LOB data.

Returns
pointer to the location where page number is written.

◆ get_prev()

fil_addr_t lob::index_entry_t::get_prev ( ) const
inline

Get the previous index entry.

Returns
The file address of previous index entry.

◆ get_self()

fil_addr_t lob::index_entry_t::get_self ( ) const

Get the location of the current index entry.

◆ get_trx_id()

trx_id_t lob::index_entry_t::get_trx_id ( ) const
inline

◆ get_trx_id_modifier()

trx_id_t lob::index_entry_t::get_trx_id_modifier ( ) const
inline

◆ get_trx_undo_no()

undo_no_t lob::index_entry_t::get_trx_undo_no ( ) const
inline

◆ get_trx_undo_no_modifier()

undo_no_t lob::index_entry_t::get_trx_undo_no_modifier ( ) const
inline

Get the undo number of the modifier trx.

Returns
the undo number of the modifier trx.

◆ get_trx_undo_no_modifier_ptr()

byte * lob::index_entry_t::get_trx_undo_no_modifier_ptr ( ) const
inlineprotected

Get pointer to location where undo number of modifier trx is written.

Returns
pointer to location where undo number of modifier trx is written.

◆ get_trx_undo_no_ptr()

byte * lob::index_entry_t::get_trx_undo_no_ptr ( ) const
inlineprotected

Get pointer to location where undo number of creator trx is written.

Returns
pointer to location where undo number of creator trx is written.

◆ get_trxid_modifier_ptr()

byte * lob::index_entry_t::get_trxid_modifier_ptr ( ) const
inlineprotected

Get pointer to the location where the modifier trx id is written.

Returns
pointer to the location where the modifier trx id is written.

◆ get_trxid_ptr()

byte * lob::index_entry_t::get_trxid_ptr ( ) const
inlineprotected

Get pointer to the location where the creator trx id is written.

Returns
pointer to the location where the creator trx id is written.

◆ get_versions_list()

flst_base_node_t * lob::index_entry_t::get_versions_list ( ) const
inline

◆ get_versions_mem()

flst_bnode_t lob::index_entry_t::get_versions_mem ( ) const
inline

Get the base node of the list of versions.

◆ get_versions_ptr()

byte * lob::index_entry_t::get_versions_ptr ( ) const
inlineprotected

Get pointer to the base node of the list of versions.

Returns
pointer to the base node of the list of versions.

◆ init()

void lob::index_entry_t::init ( void  )
inline

Initialize the object fully.

◆ insert_after()

void lob::index_entry_t::insert_after ( flst_base_node_t base,
index_entry_t entry 
)
inline

◆ insert_before()

void lob::index_entry_t::insert_before ( flst_base_node_t base,
index_entry_t entry 
)
inline

◆ is_null()

bool lob::index_entry_t::is_null ( ) const
inline

◆ is_same()

bool lob::index_entry_t::is_same ( const index_entry_t that)
inline

◆ load_s()

buf_block_t * lob::index_entry_t::load_s ( const fil_addr_t addr)

Load the index entry available in the given file address.

Take s-latch on the index page.

Parameters
[in]addrthe file location of index entry.
Returns
the buffer block.

◆ load_x()

buf_block_t * lob::index_entry_t::load_x ( const fil_addr_t addr)

Load the index entry available in the given file address.

Take x-latch on the index page.

Parameters
[in]addrthe file address of the index entry.
Returns
the buffer block containing the index entry.

◆ make_old_version_current()

fil_addr_t lob::index_entry_t::make_old_version_current ( dict_index_t index,
first_page_t first_page 
)

The current index entry points to a latest LOB page.

It may or may not have older versions. If older version is there, bring it back to the index list from the versions list. Then remove the current entry from the index list. Move the versions list from current entry to older entry.

Parameters
[in]indexthe clustered index containing the LOB.
[in]first_pageThe first lob page containing index list and free list.
Returns
the location of next entry.

◆ move_version_base_node()

void lob::index_entry_t::move_version_base_node ( index_entry_t to_entry)
private

Move the version base node from current entry to the given entry.

Parameters
[in]to_entryThe index entry to which the version base node is moved to.

◆ next()

buf_block_t * lob::index_entry_t::next ( void  )
inline

Make the current index entry object to point to the next index entry object.

Returns
the buffer block in which the next index entry is available.

◆ print()

std::ostream & lob::index_entry_t::print ( std::ostream &  out) const

◆ purge()

void lob::index_entry_t::purge ( dict_index_t index)
private

Purge the current index entry.

An index entry points to either a FIRST page or DATA page. That LOB page will be freed if it is DATA page. A FIRST page should not be freed.

◆ purge_version()

fil_addr_t lob::index_entry_t::purge_version ( dict_index_t index,
flst_base_node_t lst,
flst_base_node_t free_list 
)

Purge the current entry.

Parameters
[in]indexthe clustered index containing the LOB.
[in]lstthe base node of index list.
[in]free_listthe base node of free list.
Returns
the location of the next entry.

◆ push_back()

void lob::index_entry_t::push_back ( flst_base_node_t bnode)
inline

Add this node as the last node in the given list.

Parameters
[in]bnodethe base node of the file list.

◆ read()

void lob::index_entry_t::read ( index_entry_mem_t entry_mem) const

◆ remove()

void lob::index_entry_t::remove ( flst_base_node_t bnode)
inline

◆ reset() [1/2]

void lob::index_entry_t::reset ( fil_addr_t addr)
inline

◆ reset() [2/2]

void lob::index_entry_t::reset ( flst_node_t node)
inline

◆ set_data_len()

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

◆ set_lob_version()

void lob::index_entry_t::set_lob_version ( uint32_t  version)
inline

Set the LOB version of this entry.

Parameters
[in]versionthe LOB version number.

◆ set_next_null()

void lob::index_entry_t::set_next_null ( )
inline

◆ set_old_version()

void lob::index_entry_t::set_old_version ( index_entry_t entry)
inline

◆ set_page_no()

void lob::index_entry_t::set_page_no ( page_no_t  num)
inline

◆ set_prev_null()

void lob::index_entry_t::set_prev_null ( )
inline

◆ set_trx_id()

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

◆ set_trx_id_modifier()

void lob::index_entry_t::set_trx_id_modifier ( trx_id_t  id)
inline

◆ set_trx_id_modifier_no_redo()

void lob::index_entry_t::set_trx_id_modifier_no_redo ( trx_id_t  id)
inline

Write the modifier trx identifier to the index entry.

No redo log is generated for this modification. This is meant to be used during tablespace import.

Parameters
[in]idthe trx identifier.

◆ set_trx_id_no_redo()

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

Write the trx identifier to the index entry.

No redo log is generated for this modification. This is meant to be used during tablespace import.

Parameters
[in]idthe trx identifier.

◆ set_trx_undo_no()

void lob::index_entry_t::set_trx_undo_no ( undo_no_t  undo_no)
inline

◆ set_trx_undo_no_modifier()

void lob::index_entry_t::set_trx_undo_no_modifier ( undo_no_t  undo_no)
inline

◆ set_versions_null()

void lob::index_entry_t::set_versions_null ( )
inline

The versions base node is set to NULL.

Member Data Documentation

◆ m_block

buf_block_t* lob::index_entry_t::m_block
private

◆ m_index

const dict_index_t* lob::index_entry_t::m_index
private

◆ m_mtr

mtr_t* lob::index_entry_t::m_mtr
private

◆ m_node

byte* lob::index_entry_t::m_node {nullptr}
protected

Pointer to the blob index entry node.

◆ OFFSET_DATA_LEN

const ulint lob::index_entry_t::OFFSET_DATA_LEN = OFFSET_PAGE_NO + 4
static

◆ OFFSET_LOB_VERSION

const ulint lob::index_entry_t::OFFSET_LOB_VERSION = OFFSET_DATA_LEN + 4
static

The LOB version number.

◆ OFFSET_NEXT

const ulint lob::index_entry_t::OFFSET_NEXT = OFFSET_PREV + FIL_ADDR_SIZE
static

◆ OFFSET_PAGE_NO

const ulint lob::index_entry_t::OFFSET_PAGE_NO = OFFSET_TRX_UNDO_NO_MODIFIER + 4
static

◆ OFFSET_PREV

const ulint lob::index_entry_t::OFFSET_PREV = 0
static

Index entry offsets within node.

◆ OFFSET_TRX_UNDO_NO

const ulint lob::index_entry_t::OFFSET_TRX_UNDO_NO = OFFSET_TRXID_MODIFIER + 6
static

◆ OFFSET_TRX_UNDO_NO_MODIFIER

const ulint lob::index_entry_t::OFFSET_TRX_UNDO_NO_MODIFIER = OFFSET_TRX_UNDO_NO + 4
static

The undo number of the modifier trx.

◆ OFFSET_TRXID

const ulint lob::index_entry_t::OFFSET_TRXID = OFFSET_VERSIONS + FLST_BASE_NODE_SIZE
static

The creator trx id.

◆ OFFSET_TRXID_MODIFIER

const ulint lob::index_entry_t::OFFSET_TRXID_MODIFIER = OFFSET_TRXID + 6
static

The modifier trx id.

◆ OFFSET_VERSIONS

const ulint lob::index_entry_t::OFFSET_VERSIONS = OFFSET_NEXT + FIL_ADDR_SIZE
static

Points to base node of the list of versions.

The size of base node is 16 bytes.

◆ SIZE

const ulint lob::index_entry_t::SIZE = OFFSET_LOB_VERSION + 4
static

Total length of an index node.


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