MySQL 8.0.39
Source Code Documentation
anonymous_namespace{binlog.cc}::Row_data_memory Class Reference

Class to handle temporary allocation of memory for row data. More...

Public Member Functions

 Row_data_memory (TABLE *table, const uchar *data)
 Build an object to keep track of a block-local piece of memory for storing a row of data. More...
 
 Row_data_memory (TABLE *table, const uchar *data1, const uchar *data2, ulonglong value_options=0)
 
 ~Row_data_memory ()
 
bool has_memory () const
 Is there memory allocated? More...
 
ucharslot (uint s)
 

Private Member Functions

size_t max_row_length (TABLE *table, const uchar *data, ulonglong value_options=0)
 Compute an upper bound on the amount of memory needed. More...
 
void allocate_memory (TABLE *const table, const size_t total_length)
 

Private Attributes

bool m_alloc_checked
 
bool m_release_memory_on_destruction
 
ucharm_memory
 
ucharm_ptr [2]
 

Detailed Description

Class to handle temporary allocation of memory for row data.

The responsibilities of the class is to provide memory for packing one or two rows of packed data (depending on what constructor is called).

In order to make the allocation more efficient for rows without blobs, a pointer to the allocated memory is stored in the table structure for such rows. If memory for a table containing a blob field is requested, only memory for that is allocated, and subsequently released when the object is destroyed.

Constructor & Destructor Documentation

◆ Row_data_memory() [1/2]

anonymous_namespace{binlog.cc}::Row_data_memory::Row_data_memory ( TABLE table,
const uchar data 
)
inline

Build an object to keep track of a block-local piece of memory for storing a row of data.

Parameters
tableTable where the pre-allocated memory is stored.
dataPointer to the table record.

◆ Row_data_memory() [2/2]

anonymous_namespace{binlog.cc}::Row_data_memory::Row_data_memory ( TABLE table,
const uchar data1,
const uchar data2,
ulonglong  value_options = 0 
)
inline

◆ ~Row_data_memory()

anonymous_namespace{binlog.cc}::Row_data_memory::~Row_data_memory ( )
inline

Member Function Documentation

◆ allocate_memory()

void anonymous_namespace{binlog.cc}::Row_data_memory::allocate_memory ( TABLE *const  table,
const size_t  total_length 
)
inlineprivate

◆ has_memory()

bool anonymous_namespace{binlog.cc}::Row_data_memory::has_memory ( ) const
inline

Is there memory allocated?

Return values
trueThere is memory allocated
falseMemory allocation failed

◆ max_row_length()

size_t anonymous_namespace{binlog.cc}::Row_data_memory::max_row_length ( TABLE table,
const uchar data,
ulonglong  value_options = 0 
)
inlineprivate

Compute an upper bound on the amount of memory needed.

This may return an over-approximation.

Parameters
tableThe table
dataThe server's row record.
value_optionsThe value of @global.binlog_row_value_options

◆ slot()

uchar * anonymous_namespace{binlog.cc}::Row_data_memory::slot ( uint  s)
inline

Member Data Documentation

◆ m_alloc_checked

bool anonymous_namespace{binlog.cc}::Row_data_memory::m_alloc_checked
mutableprivate

◆ m_memory

uchar* anonymous_namespace{binlog.cc}::Row_data_memory::m_memory
private

◆ m_ptr

uchar* anonymous_namespace{binlog.cc}::Row_data_memory::m_ptr[2]
private

◆ m_release_memory_on_destruction

bool anonymous_namespace{binlog.cc}::Row_data_memory::m_release_memory_on_destruction
private

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