MySQL 9.0.0
Source Code Documentation
|
The first page of an zlob. More...
#include <zlob0first.h>
Public Member Functions | |
ulint | get_n_index_entries () const |
Given the page size, what is the number of index entries the first page can contain. More... | |
ulint | get_n_frag_entries () const |
Given the page size, what is the number of frag entries the first page can contain. More... | |
ulint | size_of_index_entries () const |
ulint | size_of_frag_entries () const |
ulint | begin_frag_entries () const |
ulint | begin_data () const |
bool | is_empty () const |
ulint | get_index_list_length () const |
Get the length of the index list. More... | |
void | set_version_0 () |
byte * | begin_data_ptr () const |
ulint | payload () |
Amount of zlob data that can be stored in first page (in bytes). More... | |
z_first_page_t () | |
z_first_page_t (mtr_t *mtr, dict_index_t *index) | |
z_first_page_t (buf_block_t *block) | |
z_first_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index) | |
buf_block_t * | alloc (bool bulk) |
void | import (trx_id_t trx_id) |
page_type_t | get_page_type () const |
buf_block_t * | load_x (page_no_t page_no) |
Load the given page number as the first page in x-latch mode. More... | |
buf_block_t * | load_x (mtr_t *mtr) const |
Load the first page using given mini-transaction. More... | |
buf_block_t * | load_x (const page_id_t &page_id, const page_size_t &page_size) |
Load the first page of the compressed LOB with x-latch. More... | |
buf_block_t * | load_s (page_no_t page_no) |
Load the given page number as the first page in s-latch mode. More... | |
void | dealloc () |
Deallocate the first page of a compressed LOB. More... | |
void | set_next_page_null () |
Set the FIL_PAGE_NEXT to FIL_NULL. More... | |
void | set_prev_page_null () |
Set the FIL_PAGE_PREV to FIL_NULL. More... | |
void | set_next_page_no (page_no_t page_no, mtr_t *mtr) |
Set the FIL_PAGE_NEXT to the given value. More... | |
void | set_prev_page_no (page_no_t page_no, mtr_t *mtr) |
Set the FIL_PAGE_PREV to the given value. More... | |
void | set_space_id_no_redo (space_id_t space_id) |
Write the space identifier to the page header, without generating redo log records. More... | |
void | init () |
ulint | get_data_len () const |
Get the amount of zlob data stored in this page. More... | |
page_no_t | get_page_no () const |
Get the page number. More... | |
page_id_t | get_page_id () const |
Get the page id of the first page of compressed LOB. More... | |
fil_addr_t | get_self_addr () const |
void | set_index_page_no (page_no_t page_no) |
All the index pages are singly linked with each other, and the first page contains the link to one index page. More... | |
void | set_index_page_no (page_no_t page_no, mtr_t *mtr) |
All the index pages are singly linked with each other, and the first page contains the link to one index page. More... | |
page_no_t | get_index_page_no () const |
All the index pages are singly linked with each other, and the first page contains the link to one index page. More... | |
page_no_t | get_frag_page_no () const |
All the fragment pages are doubly linked with each other, and the first page contains the link to one fragment page in FIL_PAGE_PREV. More... | |
page_no_t | get_frag_page_no (mtr_t *mtr) const |
All the fragment pages are doubly linked with each other, and the first page contains the link to one fragment page in FIL_PAGE_PREV. More... | |
bool | verify_frag_page_no () |
Verify that the page number pointed to by FIL_PAGE_PREV of the first page of LOB is indeed a fragment page. More... | |
void | set_frag_page_no (mtr_t *mtr, page_no_t page_no) |
All the fragment pages (. More... | |
void | set_frag_page_no (page_no_t page_no) |
All the fragment pages (. More... | |
void | set_frag_node_page_no (page_no_t page_no) |
All the frag node pages (. More... | |
void | set_frag_node_page_no (page_no_t page_no, mtr_t *mtr) |
All the frag node pages (. More... | |
size_t | free_all_frag_node_pages () |
Free all the z_frag_page_t pages. More... | |
size_t | free_all_index_pages () |
Free all the index pages. More... | |
size_t | free_all_frag_pages () |
Free all the fragment pages. More... | |
size_t | free_all_data_pages () |
Free all the data pages. More... | |
page_no_t | get_frag_node_page_no () |
All the frag node pages are singly linked with each other, and the first page contains the link to one frag node page. More... | |
void | set_page_type_unknown () |
Set the page type to FIL_PAGE_TYPE_UNKNOWN. More... | |
void | set_page_type () |
void | set_data_len (ulint len) |
void | set_trx_id (trx_id_t tid) |
Update the trx id in the header. More... | |
void | set_trx_id_no_redo (trx_id_t tid) |
Update the trx id in the header, without generating redo log records. More... | |
void | init_lob_version () |
Initialize the LOB version to 1. More... | |
uint32_t | get_lob_version () |
Get the LOB version. More... | |
uint32_t | incr_lob_version () |
Increment LOB version by 1. More... | |
uint8_t | get_flags () |
Get one byte of flags. More... | |
bool | can_be_partially_updated () |
When the bit is set, the LOB is not partially updatable anymore. More... | |
void | mark_cannot_be_partially_updated (trx_t *trx) |
When the bit is set, the LOB is not partially updatable anymore. More... | |
void | set_last_trx_id (trx_id_t tid) |
void | set_last_trx_id_no_redo (trx_id_t tid) |
Update the last transaction identifier in the header, without generating redo logs. More... | |
void | set_last_trx_undo_no (undo_no_t undo_no) |
trx_id_t | get_last_trx_id () const |
undo_no_t | get_last_trx_undo_no () const |
flst_base_node_t * | free_list () const |
flst_base_node_t * | index_list () const |
flst_base_node_t * | free_frag_list () const |
flst_base_node_t * | frag_list () const |
void | init_frag_entries () |
void | init_index_entries () |
frag_id_t | alloc_fragment (bool bulk, ulint len, z_frag_page_t &frag_page, z_frag_entry_t &entry) |
Allocate a fragment of the given size. More... | |
z_index_entry_t | alloc_index_entry (bool bulk) |
Allocate one index entry. More... | |
z_frag_entry_t | alloc_frag_entry (bool bulk) |
Allocate one frag page entry. More... | |
std::ostream & | print_index_entries (std::ostream &out) const |
Print the index entries. More... | |
std::ostream & | print_frag_entries (std::ostream &out) const |
Print the index entries. More... | |
std::ostream & | print (std::ostream &out) const |
Print the page. More... | |
byte * | frame () const |
flst_node_t * | addr2ptr_x (fil_addr_t &addr) const |
Load the page, in x-latch mode, containing the given file address. More... | |
flst_node_t * | addr2ptr_x (fil_addr_t &addr, mtr_t *mtr) const |
Load the page, in x-latch mode, containing the given file address. More... | |
flst_node_t * | addr2ptr_s (fil_addr_t &addr) |
Load the page, in s-latch mode, containing the given file address. More... | |
void | load_entry_s (fil_addr_t &addr, z_index_entry_t &entry) |
Load the entry available in the given file address. More... | |
void | load_entry_x (fil_addr_t &addr, z_index_entry_t &entry) |
Load the entry available in the given file address. More... | |
size_t | destroy () |
Free all the pages of the zlob. More... | |
size_t | make_empty () |
Free all the pages of the zlob except the first page. More... | |
bool | validate () |
Validate the LOB. More... | |
buf_block_t * | get_block () const |
Get the buffer block of the first page of LOB. More... | |
void | set_mtr (mtr_t *mtr) |
void | restart_mtr (mtr_t *mtr) |
Restart the given mtr. More... | |
Static Public Attributes | |
static const ulint | OFFSET_VERSION = FIL_PAGE_DATA |
Version information. More... | |
static const ulint | OFFSET_FLAGS = FIL_PAGE_DATA + 1 |
One byte of flag bits. More... | |
static const uint32_t | OFFSET_LOB_VERSION = OFFSET_FLAGS + 1 |
LOB version. More... | |
static const ulint | OFFSET_LAST_TRX_ID = OFFSET_LOB_VERSION + 4 |
The last transaction that modified this LOB. More... | |
static const ulint | OFFSET_LAST_UNDO_NO = OFFSET_LAST_TRX_ID + 6 |
The last transaction that modified this LOB. More... | |
static const ulint | OFFSET_DATA_LEN = OFFSET_LAST_UNDO_NO + 4 |
The length of compressed data stored in this page. More... | |
static const ulint | OFFSET_TRX_ID = OFFSET_DATA_LEN + 4 |
The transaction that created data in the data portion. More... | |
static const ulint | OFFSET_INDEX_PAGE_NO = OFFSET_TRX_ID + 6 |
The next index page. More... | |
static const ulint | OFFSET_FRAG_NODES_PAGE_NO = OFFSET_INDEX_PAGE_NO + 4 |
The next frag nodes page. More... | |
static const ulint | OFFSET_FREE_LIST = OFFSET_FRAG_NODES_PAGE_NO + 4 |
List of free index entries. More... | |
static const ulint | OFFSET_INDEX_LIST = OFFSET_FREE_LIST + FLST_BASE_NODE_SIZE |
List of index entries. More... | |
static const ulint | OFFSET_FREE_FRAG_LIST |
List of free frag entries. More... | |
static const ulint | OFFSET_FRAG_LIST |
List of frag entries. More... | |
static const ulint | OFFSET_INDEX_BEGIN |
Begin of index entries. More... | |
Private Member Functions | |
size_t | free_all_frag_pages_old () |
Free all the fragment pages when the next page of the first LOB page IS NOT USED to link the fragment pages. More... | |
size_t | free_all_frag_pages_new () |
Free all the fragment pages when the next page of the first LOB page IS USED to link the fragment pages. More... | |
bool | validate_low () |
Validate the LOB. More... | |
Private Attributes | |
buf_block_t * | m_block |
The buffer block of the first page. More... | |
mtr_t * | m_mtr |
The mini-transaction context. More... | |
dict_index_t * | m_index |
The index dictionary object. More... | |
The first page of an zlob.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Load the page, in s-latch mode, containing the given file address.
[in] | addr | given file address |
|
inline |
Load the page, in x-latch mode, containing the given file address.
[in] | addr | given file address |
|
inline |
Load the page, in x-latch mode, containing the given file address.
[in] | addr | given file address |
[in] | mtr | the mini-transaction context to be used. |
buf_block_t * lob::z_first_page_t::alloc | ( | bool | bulk | ) |
z_frag_entry_t lob::z_first_page_t::alloc_frag_entry | ( | bool | bulk | ) |
Allocate one frag page entry.
If there is no free frag entry, allocate an frag node page (a page full of z_frag_entry_t objects) and service the request.
frag_id_t lob::z_first_page_t::alloc_fragment | ( | bool | bulk, |
ulint | len, | ||
z_frag_page_t & | frag_page, | ||
z_frag_entry_t & | entry | ||
) |
Allocate a fragment of the given size.
This involves finding a fragment page, that has space to store len bytes of data. If necessary, allocate a new fragment page.
[in] | bulk | true if it is bulk operation (OPCODE_INSERT_BULK), false otherwise. |
[in] | len | length of data to be stored in fragment page. |
[out] | frag_page | the fragment page with the needed free space. |
[out] | entry | fragment page entry representing frag_page. |
z_index_entry_t lob::z_first_page_t::alloc_index_entry | ( | bool | bulk | ) |
Allocate one index entry.
If there is no free index entry, allocate an index page (a page full of z_index_entry_t objects) and service the request.
|
inline |
|
inline |
|
inline |
|
inline |
When the bit is set, the LOB is not partially updatable anymore.
void lob::z_first_page_t::dealloc | ( | ) |
Deallocate the first page of a compressed LOB.
size_t lob::z_first_page_t::destroy | ( | ) |
Free all the pages of the zlob.
|
inline |
|
inline |
size_t lob::z_first_page_t::free_all_data_pages | ( | ) |
Free all the data pages.
size_t lob::z_first_page_t::free_all_frag_node_pages | ( | ) |
Free all the z_frag_page_t pages.
All the z_frag_page_t pages are singly linked to each other. The head of the list is maintained in the first page.
All the z_frag_page_t pages are singly linked to each other. The head of the list is maintained in the first page.
size_t lob::z_first_page_t::free_all_frag_pages | ( | ) |
Free all the fragment pages.
|
private |
Free all the fragment pages when the next page of the first LOB page IS USED to link the fragment pages.
|
private |
Free all the fragment pages when the next page of the first LOB page IS NOT USED to link the fragment pages.
size_t lob::z_first_page_t::free_all_index_pages | ( | ) |
Free all the index pages.
|
inline |
|
inline |
|
inline |
Get the buffer block of the first page of LOB.
|
inline |
Get the amount of zlob data stored in this page.
|
inline |
Get one byte of flags.
|
inline |
All the frag node pages are singly linked with each other, and the first page contains the link to one frag node page.
Get that frag node page number.
|
inline |
All the fragment pages are doubly linked with each other, and the first page contains the link to one fragment page in FIL_PAGE_PREV.
Get that frag page number.
All the fragment pages are doubly linked with each other, and the first page contains the link to one fragment page in FIL_PAGE_PREV.
Get that frag page number.
[in] | mtr | Mini-transaction to use for this read operation. |
|
inline |
Get the length of the index list.
|
inline |
All the index pages are singly linked with each other, and the first page contains the link to one index page.
Get that index page number.
|
inline |
|
inline |
|
inline |
Get the LOB version.
ulint lob::z_first_page_t::get_n_frag_entries | ( | ) | const |
Given the page size, what is the number of frag entries the first page can contain.
ulint lob::z_first_page_t::get_n_index_entries | ( | ) | const |
Given the page size, what is the number of index entries the first page can contain.
|
inline |
Get the page id of the first page of compressed LOB.
|
inline |
Get the page number.
|
inline |
|
inline |
void lob::z_first_page_t::import | ( | trx_id_t | trx_id | ) |
uint32_t lob::z_first_page_t::incr_lob_version | ( | ) |
Increment LOB version by 1.
Increment the LOB version by 1.
|
inline |
|
inline |
|
inline |
void lob::z_first_page_t::init_index_entries | ( | ) |
|
inline |
Initialize the LOB version to 1.
|
inline |
void lob::z_first_page_t::load_entry_s | ( | fil_addr_t & | addr, |
z_index_entry_t & | entry | ||
) |
Load the entry available in the given file address.
[in] | addr | file address |
[out] | entry | the entry to be loaded. |
void lob::z_first_page_t::load_entry_x | ( | fil_addr_t & | addr, |
z_index_entry_t & | entry | ||
) |
Load the entry available in the given file address.
[in] | addr | file address |
[out] | entry | the entry to be loaded. |
|
inline |
Load the given page number as the first page in s-latch mode.
[in] | page_no | the first page number. |
buf_block_t * lob::z_first_page_t::load_x | ( | const page_id_t & | page_id, |
const page_size_t & | page_size | ||
) |
Load the first page of the compressed LOB with x-latch.
[in] | page_id | the page identifier of first page |
[in] | page_size | the page size information of table. |
|
inline |
Load the first page using given mini-transaction.
The first page must already be x-latched by the m_mtr.
[in] | mtr | the mini-transaction in which first page is to be loaded. |
|
inline |
Load the given page number as the first page in x-latch mode.
[in] | page_no | the first page number. |
size_t lob::z_first_page_t::make_empty | ( | ) |
Free all the pages of the zlob except the first page.
void lob::z_first_page_t::mark_cannot_be_partially_updated | ( | trx_t * | trx | ) |
When the bit is set, the LOB is not partially updatable anymore.
Enable the bit.
[in] | trx | the current transaction. |
|
inline |
Amount of zlob data that can be stored in first page (in bytes).
std::ostream & lob::z_first_page_t::print | ( | std::ostream & | out | ) | const |
Print the page.
std::ostream & lob::z_first_page_t::print_frag_entries | ( | std::ostream & | out | ) | const |
Print the index entries.
Print the frag entries.
std::ostream & lob::z_first_page_t::print_index_entries | ( | std::ostream & | out | ) | const |
Print the index entries.
|
inline |
Restart the given mtr.
The first page must already be x-latched by the m_mtr.
[in] | mtr | the mini-transaction context which is to be restarted. |
|
inline |
|
inline |
All the frag node pages (.
[in] | page_no | the page number of an frag node page. |
All the frag node pages (.
[in] | page_no | the page number of an frag node page. |
[in] | mtr | mini trx context to generate redo logs. |
All the fragment pages (.
[in] | mtr | Mini-transaction for this modification. |
[in] | page_no | The page number of a fragment page. |
|
inline |
All the fragment pages (.
[in] | page_no | the page number of a fragment page. |
|
inline |
All the index pages are singly linked with each other, and the first page contains the link to one index page.
[in] | page_no | the page number of an index page. |
All the index pages are singly linked with each other, and the first page contains the link to one index page.
[in] | page_no | the page number of an index page. |
[in] | mtr | use this mini transaction context for redo logs. |
|
inline |
|
inline |
Update the last transaction identifier in the header, without generating redo logs.
[in] | tid | given transaction identifier. |
|
inline |
|
inline |
Set the FIL_PAGE_NEXT to the given value.
[in] | page_no | the page number to set in FIL_PAGE_NEXT. |
[in] | mtr | mini trx to be used for this modification. |
|
inline |
Set the FIL_PAGE_NEXT to FIL_NULL.
|
inline |
|
inline |
Set the page type to FIL_PAGE_TYPE_UNKNOWN.
This is done while deallocating this page.
Set the FIL_PAGE_PREV to the given value.
[in] | page_no | the page number to set in FIL_PAGE_PREV. |
[in] | mtr | mini trx to be used for this modification. |
|
inline |
Set the FIL_PAGE_PREV to FIL_NULL.
|
inline |
Write the space identifier to the page header, without generating redo log records.
[in] | space_id | the space identifier. |
|
inline |
Update the trx id in the header.
[in] | tid | the given transaction identifier. |
|
inline |
Update the trx id in the header, without generating redo log records.
[in] | tid | the given transaction identifier. |
|
inline |
|
inline |
ulint lob::z_first_page_t::size_of_index_entries | ( | ) | const |
|
inline |
Validate the LOB.
|
private |
Validate the LOB.
This is a costly function. We need to avoid using this directly, instead call z_first_page_t::validate().
bool lob::z_first_page_t::verify_frag_page_no | ( | ) |
Verify that the page number pointed to by FIL_PAGE_PREV of the first page of LOB is indeed a fragment page.
It uses its own mtr internally.
|
private |
The buffer block of the first page.
|
private |
The index dictionary object.
|
private |
The mini-transaction context.
|
static |
The length of compressed data stored in this page.
|
static |
One byte of flag bits.
Currently only one bit (the least significant bit) is used, other 7 bits are available for future use.
|
static |
List of frag entries.
|
static |
The next frag nodes page.
|
static |
List of free frag entries.
|
static |
List of free index entries.
|
static |
Begin of index entries.
|
static |
List of index entries.
|
static |
The next index page.
|
static |
The last transaction that modified this LOB.
|
static |
The last transaction that modified this LOB.
|
static |
LOB version.
4 bytes.
|
static |
The transaction that created data in the data portion.
|
static |
Version information.
One byte.