MySQL  8.0.21
Source Code Documentation
lob::BtrContext Class Reference

The B-tree context under which the LOB operation is done. More...

#include <lob0lob.h>

Inheritance diagram for lob::BtrContext:
lob::DeleteContext lob::InsertContext

Public Member Functions

 BtrContext ()
 Default Constructor. More...
 
 BtrContext (mtr_t *mtr, btr_pcur_t *pcur, dict_index_t *index, rec_t *rec, ulint *offsets, buf_block_t *block)
 Constructor. More...
 
 BtrContext (mtr_t *mtr, btr_pcur_t *pcur, dict_index_t *index, rec_t *rec, ulint *offsets, buf_block_t *block, opcode op)
 Constructor. More...
 
 BtrContext (const BtrContext &other)
 Copy Constructor. More...
 
void disown_inherited_fields (const upd_t *update)
 Marks non-updated off-page fields as disowned by this record. More...
 
void set_ownership_of_extern_field (ulint i, ibool val)
 Sets the ownership bit of an externally stored field in a record. More...
 
void unmark_extern_fields ()
 Marks all extern fields in a record as owned by the record. More...
 
void free_externally_stored_fields (trx_id_t trx_id, undo_no_t undo_no, bool rollback, ulint rec_type)
 Frees the externally stored fields for a record. More...
 
void free_updated_extern_fields (trx_id_t trx_id, undo_no_t undo_no, const upd_t *update, bool rollback)
 Frees the externally stored fields for a record, if the field is mentioned in the update vector. More...
 
page_zip_des_tget_page_zip () const
 Gets the compressed page descriptor. More...
 
page_no_t get_page_no () const
 Get the page number of clustered index block. More...
 
ulint get_rec_offset () const
 Get the record offset within page of the clustered index record. More...
 
bool need_recalc () const
 Check if there is a need to recalculate the context information. More...
 
rec_trec () const
 Get the clustered index record pointer. More...
 
byteget_field_ref (ulint field_no) const
 Get the LOB reference for the given field number. More...
 
bool validate () const
 Validate the current BLOB context object. More...
 
bool are_all_blobrefs_valid () const
 Check to see if all pointers to externally stored columns in the record must be valid. More...
 
bool is_bulk () const
 Determine whether current operation is a bulk insert operation. More...
 
const page_trec_frame () const
 Get the beginning of the B-tree clustered index page frame that contains the current clustered index record (m_rec). More...
 
void commit_btr_mtr ()
 Commit the mini transaction that is holding the latches of the clustered index record block. More...
 
void start_btr_mtr ()
 Start the mini transaction that will be holding the latches of the clustered index record block. More...
 
page_no_t get_btr_page_no () const
 Get the page number of clustered index record. More...
 
void rec_block_fix ()
 Increment the buffer fix count of the clustered index record block. More...
 
void rec_block_unfix ()
 Decrement the buffer fix count of the clustered index record block. More...
 
void restore_position ()
 Restore the position of the persistent cursor. More...
 
dict_index_tindex () const
 Get the index object. More...
 
dict_table_ttable () const
 Get the table object. More...
 
space_id_t space () const
 Get the space id. More...
 
const page_size_t page_size () const
 Obtain the page size of the underlying table. More...
 
page_no_t pages_in_extent () const
 Determine the extent size (in pages) for the underlying table. More...
 
void check_redolog ()
 Check if there is enough space in the redo log file. More...
 
void restart_mtr ()
 The btr mini transaction will be restarted. More...
 
void make_nth_extern (ulint field_no)
 Mark the nth field as externally stored. More...
 
mtr_log_t get_log_mode ()
 Get the log mode of the btr mtr. More...
 
FlushObserverget_flush_observer () const
 Get flush observer. More...
 
ulint * get_offsets () const
 Get the record offsets array. More...
 
bool rec_offs_validate () const
 Validate the record offsets array. More...
 
mtr_tget_mtr ()
 Get the associated mini-transaction. More...
 
buf_block_tblock () const
 Get the pointer to the clustered record block. More...
 
void store_position ()
 Save the position of the persistent cursor. More...
 
void check_redolog_normal ()
 Check if there is enough space in log file. More...
 
void check_redolog_bulk ()
 When bulk load is being done, check if there is enough space in redo log file. More...
 
void restart_mtr_normal ()
 Commit and re-start the mini transaction. More...
 
void restart_mtr_bulk ()
 When bulk load is being done, Commit and re-start the mini transaction. More...
 
void recalc ()
 Recalculate some of the members after restoring the persistent cursor. More...
 
void zblob_write_blobref (ulint field_no, mtr_t *mtr)
 Write a blob reference of a field into a clustered index record in a compressed leaf page. More...
 

Public Attributes

mtr_tm_mtr
 
btr_pcur_tm_pcur
 
dict_index_tm_index
 
rec_tm_rec
 
ulint * m_offsets
 
buf_block_tm_block
 
opcode m_op
 
ulint m_rec_offset
 Record offset within the page. More...
 
page_no_t m_btr_page_no
 Page number where the clust rec is present. More...
 

Detailed Description

The B-tree context under which the LOB operation is done.

Constructor & Destructor Documentation

◆ BtrContext() [1/4]

lob::BtrContext::BtrContext ( )
inline

Default Constructor.

◆ BtrContext() [2/4]

lob::BtrContext::BtrContext ( mtr_t mtr,
btr_pcur_t pcur,
dict_index_t index,
rec_t rec,
ulint *  offsets,
buf_block_t block 
)
inline

Constructor.

◆ BtrContext() [3/4]

lob::BtrContext::BtrContext ( mtr_t mtr,
btr_pcur_t pcur,
dict_index_t index,
rec_t rec,
ulint *  offsets,
buf_block_t block,
opcode  op 
)
inline

Constructor.

◆ BtrContext() [4/4]

lob::BtrContext::BtrContext ( const BtrContext other)
inline

Copy Constructor.

Member Function Documentation

◆ are_all_blobrefs_valid()

bool lob::BtrContext::are_all_blobrefs_valid ( ) const
inline

Check to see if all pointers to externally stored columns in the record must be valid.

Returns
true if all blob references are valid.
will not return if any blob reference is invalid.

◆ block()

buf_block_t* lob::BtrContext::block ( ) const
inline

Get the pointer to the clustered record block.

Returns
pointer to the clustered rec block.

◆ check_redolog()

void lob::BtrContext::check_redolog ( )
inline

Check if there is enough space in the redo log file.

The btr mini transaction will be restarted.

◆ check_redolog_bulk()

void lob::BtrContext::check_redolog_bulk ( )

When bulk load is being done, check if there is enough space in redo log file.

◆ check_redolog_normal()

void lob::BtrContext::check_redolog_normal ( )

Check if there is enough space in log file.

Commit and re-start the mini transaction.

◆ commit_btr_mtr()

void lob::BtrContext::commit_btr_mtr ( )
inline

Commit the mini transaction that is holding the latches of the clustered index record block.

◆ disown_inherited_fields()

void lob::BtrContext::disown_inherited_fields ( const upd_t update)

Marks non-updated off-page fields as disowned by this record.

The ownership must be transferred to the updated record which is inserted elsewhere in the index tree. In purge only the owner of externally stored field is allowed to free the field.

Parameters
[in]updateupdate vector.

◆ free_externally_stored_fields()

void lob::BtrContext::free_externally_stored_fields ( trx_id_t  trx_id,
undo_no_t  undo_no,
bool  rollback,
ulint  rec_type 
)

Frees the externally stored fields for a record.

Parameters
[in]trx_idtransaction identifier whose LOB is being freed.
[in]undo_noundo number within a transaction whose LOB is being freed.
[in]rollbackperforming rollback?
[in]rec_typeundo record type.

◆ free_updated_extern_fields()

void lob::BtrContext::free_updated_extern_fields ( trx_id_t  trx_id,
undo_no_t  undo_no,
const upd_t update,
bool  rollback 
)

Frees the externally stored fields for a record, if the field is mentioned in the update vector.

Parameters
[in]trx_idthe transaction identifier.
[in]undo_noundo number within a transaction whose LOB is being freed.
[in]updateupdate vector
[in]rollbackperforming rollback?

◆ get_btr_page_no()

page_no_t lob::BtrContext::get_btr_page_no ( ) const
inline

Get the page number of clustered index record.

Returns
page number of clustered index record.

◆ get_field_ref()

byte* lob::BtrContext::get_field_ref ( ulint  field_no) const
inline

Get the LOB reference for the given field number.

Parameters
[in]field_nofield number.
Returns
LOB reference (aka external field reference).

◆ get_flush_observer()

FlushObserver* lob::BtrContext::get_flush_observer ( ) const
inline

Get flush observer.

Returns
flush observer

◆ get_log_mode()

mtr_log_t lob::BtrContext::get_log_mode ( )
inline

Get the log mode of the btr mtr.

Returns
the log mode.

◆ get_mtr()

mtr_t* lob::BtrContext::get_mtr ( )
inline

Get the associated mini-transaction.

Returns
the mini transaction.

◆ get_offsets()

ulint* lob::BtrContext::get_offsets ( ) const
inline

Get the record offsets array.

Returns
the record offsets array.

◆ get_page_no()

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

Get the page number of clustered index block.

Returns
the page number.

◆ get_page_zip()

page_zip_des_t* lob::BtrContext::get_page_zip ( ) const
inline

Gets the compressed page descriptor.

Returns
the compressed page descriptor.

◆ get_rec_offset()

ulint lob::BtrContext::get_rec_offset ( ) const
inline

Get the record offset within page of the clustered index record.

Returns
the record offset.

◆ index()

dict_index_t* lob::BtrContext::index ( ) const
inline

Get the index object.

Returns
index object

◆ is_bulk()

bool lob::BtrContext::is_bulk ( ) const
inline

Determine whether current operation is a bulk insert operation.

Returns
true, if bulk insert operation, false otherwise.

◆ make_nth_extern()

void lob::BtrContext::make_nth_extern ( ulint  field_no)
inline

Mark the nth field as externally stored.

Parameters
[in]field_nothe field number.

◆ need_recalc()

bool lob::BtrContext::need_recalc ( ) const
inline

Check if there is a need to recalculate the context information.

Returns
true if there is a need to recalculate, false otherwise.

◆ page_size()

const page_size_t lob::BtrContext::page_size ( ) const
inline

Obtain the page size of the underlying table.

Returns
page size of the underlying table.

◆ pages_in_extent()

page_no_t lob::BtrContext::pages_in_extent ( ) const
inline

Determine the extent size (in pages) for the underlying table.

Returns
extent size in pages

◆ rec()

rec_t* lob::BtrContext::rec ( ) const
inline

Get the clustered index record pointer.

Returns
clustered index record pointer.

◆ rec_block_fix()

void lob::BtrContext::rec_block_fix ( )
inline

Increment the buffer fix count of the clustered index record block.

◆ rec_block_unfix()

void lob::BtrContext::rec_block_unfix ( )
inline

Decrement the buffer fix count of the clustered index record block.

◆ rec_frame()

const page_t* lob::BtrContext::rec_frame ( ) const
inline

Get the beginning of the B-tree clustered index page frame that contains the current clustered index record (m_rec).

Returns
the page frame containing the clust rec.

◆ rec_offs_validate()

bool lob::BtrContext::rec_offs_validate ( ) const
inline

Validate the record offsets array.

Returns
true if validation succeeds, false otherwise.

◆ recalc()

void lob::BtrContext::recalc ( )
inline

Recalculate some of the members after restoring the persistent cursor.

◆ restart_mtr()

void lob::BtrContext::restart_mtr ( )
inline

The btr mini transaction will be restarted.

◆ restart_mtr_bulk()

void lob::BtrContext::restart_mtr_bulk ( )

When bulk load is being done, Commit and re-start the mini transaction.

◆ restart_mtr_normal()

void lob::BtrContext::restart_mtr_normal ( )

Commit and re-start the mini transaction.

◆ restore_position()

void lob::BtrContext::restore_position ( )
inline

Restore the position of the persistent cursor.

◆ set_ownership_of_extern_field()

void lob::BtrContext::set_ownership_of_extern_field ( ulint  i,
ibool  val 
)
inline

Sets the ownership bit of an externally stored field in a record.

Parameters
[in]ifield number
[in]valvalue to set

◆ space()

space_id_t lob::BtrContext::space ( ) const
inline

Get the space id.

Returns
space id.

◆ start_btr_mtr()

void lob::BtrContext::start_btr_mtr ( )
inline

Start the mini transaction that will be holding the latches of the clustered index record block.

◆ store_position()

void lob::BtrContext::store_position ( )
inline

Save the position of the persistent cursor.

◆ table()

dict_table_t* lob::BtrContext::table ( ) const
inline

Get the table object.

Returns
table object or NULL.

◆ unmark_extern_fields()

void lob::BtrContext::unmark_extern_fields ( )
inline

Marks all extern fields in a record as owned by the record.

This function should be called if the delete mark of a record is removed: a not delete marked record always owns all its extern fields.

◆ validate()

bool lob::BtrContext::validate ( ) const
inline

Validate the current BLOB context object.

The BLOB context object is valid if the necessary latches are being held by the mini-transaction of the B-tree (btr mtr). Does not return if the validation fails.

Returns
true if valid

◆ zblob_write_blobref()

void lob::BtrContext::zblob_write_blobref ( ulint  field_no,
mtr_t mtr 
)
inline

Write a blob reference of a field into a clustered index record in a compressed leaf page.

The information must already have been updated on the uncompressed page.

Parameters
[in]field_nothe blob field number
[in]mtrthe mini transaction to update blob page.

Member Data Documentation

◆ m_block

buf_block_t* lob::BtrContext::m_block

◆ m_btr_page_no

page_no_t lob::BtrContext::m_btr_page_no

Page number where the clust rec is present.

◆ m_index

dict_index_t* lob::BtrContext::m_index

◆ m_mtr

mtr_t* lob::BtrContext::m_mtr

◆ m_offsets

ulint* lob::BtrContext::m_offsets

◆ m_op

opcode lob::BtrContext::m_op

◆ m_pcur

btr_pcur_t* lob::BtrContext::m_pcur

◆ m_rec

rec_t* lob::BtrContext::m_rec

◆ m_rec_offset

ulint lob::BtrContext::m_rec_offset

Record offset within the page.


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