MySQL 8.0.39
Source Code Documentation
lob::Inserter Class Reference

Insert or write an uncompressed BLOB. More...

#include <lob0ins.h>

Inheritance diagram for lob::Inserter:
[legend]

Public Member Functions

 Inserter (InsertContext *ctx)
 Constructor. More...
 
 ~Inserter ()=default
 Destructor. More...
 
dberr_t write ()
 Write all the BLOBs of the clustered index record. More...
 
dberr_t write_one_blob (size_t blob_j)
 Write one blob field data. More...
 
dberr_t write_one_small_blob (size_t blob_j)
 Write one blob field data. More...
 
dberr_t write_single_blob_page (big_rec_field_t &field, ulint nth_blob_page)
 Write one blob page. More...
 
bool is_ok () const
 Check if the BLOB operation has reported any errors. More...
 
void set_page_next ()
 Make the current page as next page of previous page. More...
 
void log_page_type ()
 Write the page type of the current BLOB page and also generate the redo log record. More...
 
ulint payload () const
 Calculate the payload size of the BLOB page. More...
 
void write_into_single_page (big_rec_field_t &field)
 Write contents into a single BLOB page. More...
 
dberr_t write_first_page (big_rec_field_t &field)
 Write first blob page. More...
 

Private Attributes

blob_dir_t m_dir
 The BLOB directory information. More...
 
ulint m_remaining
 Data remaining to be written. More...
 
- Private Attributes inherited from lob::BaseInserter
InsertContextm_ctx
 The BLOB operation context. More...
 
dberr_t m_err
 Success or failure status of the operation so far. More...
 
mtr_t m_blob_mtr
 The mini trx used to write into blob pages. More...
 
page_no_t m_prev_page_no
 The previous BLOB page number. More...
 
buf_block_tm_cur_blob_block
 The current BLOB buf_block_t object. More...
 
page_no_t m_cur_blob_page_no
 The current BLOB page number. More...
 

Additional Inherited Members

- Private Member Functions inherited from lob::BaseInserter
 BaseInserter (InsertContext *ctx)
 Constructor. More...
 
mtr_tstart_blob_mtr ()
 Start the BLOB mtr. More...
 
buf_block_talloc_blob_page ()
 Allocate one BLOB page. More...
 
page_tget_previous_blob_page ()
 Get the previous BLOB page frame. More...
 
buf_block_tget_previous_blob_block ()
 Get the previous BLOB page block. More...
 
bool is_index_sdi ()
 Check if the index is SDI index. More...
 
page_tcur_page () const
 Get the current BLOB page frame. More...
 

Detailed Description

Insert or write an uncompressed BLOB.

Constructor & Destructor Documentation

◆ Inserter()

lob::Inserter::Inserter ( InsertContext ctx)
inline

Constructor.

Parameters
[in]ctxblob operation context.

◆ ~Inserter()

lob::Inserter::~Inserter ( )
default

Destructor.

Member Function Documentation

◆ is_ok()

bool lob::Inserter::is_ok ( ) const
inline

Check if the BLOB operation has reported any errors.

Returns
true if BLOB operation is successful, false otherwise.

◆ log_page_type()

void lob::Inserter::log_page_type ( )
inline

Write the page type of the current BLOB page and also generate the redo log record.

◆ payload()

ulint lob::Inserter::payload ( ) const
inline

Calculate the payload size of the BLOB page.

Returns
payload size in bytes.

◆ set_page_next()

void lob::Inserter::set_page_next ( )

Make the current page as next page of previous page.

In other words, make the page m_cur_blob_page_no as the next page of page m_prev_page_no.

◆ write()

dberr_t lob::Inserter::write ( )

Write all the BLOBs of the clustered index record.

Returns
DB_SUCCESS on success, error code on failure.

◆ write_first_page()

dberr_t lob::Inserter::write_first_page ( big_rec_field_t field)

Write first blob page.

Parameters
[in]fieldthe big record field.
Returns
DB_SUCCESS on success.

◆ write_into_single_page()

void lob::Inserter::write_into_single_page ( big_rec_field_t field)

Write contents into a single BLOB page.

Parameters
[in]fieldthe big record field.

◆ write_one_blob()

dberr_t lob::Inserter::write_one_blob ( size_t  blob_j)

Write one blob field data.

Parameters
[in]blob_jthe blob field number
Returns
DB_SUCCESS on success, error code on failure.

◆ write_one_small_blob()

dberr_t lob::Inserter::write_one_small_blob ( size_t  blob_j)

Write one blob field data.

Write one small blob field data.

Parameters
[in]blob_jthe blob field number
Returns
DB_SUCCESS on success, error code on failure.

◆ write_single_blob_page()

dberr_t lob::Inserter::write_single_blob_page ( big_rec_field_t field,
ulint  nth_blob_page 
)

Write one blob page.

This function will be repeatedly called with an increasing nth_blob_page to completely write a BLOB.

Parameters
[in]fieldthe big record field.
[in]nth_blob_pagecount of the BLOB page (starting from 1).
Returns
DB_SUCCESS or DB_FAIL.

Member Data Documentation

◆ m_dir

blob_dir_t lob::Inserter::m_dir
private

The BLOB directory information.

◆ m_remaining

ulint lob::Inserter::m_remaining
private

Data remaining to be written.


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