MySQL 9.1.0
Source Code Documentation
temptable::Cell Class Reference

A cell is the intersection of a row and a column. More...

#include <cell.h>

Public Member Functions

 Cell (bool is_null, uint32_t data_length, const unsigned char *data)
 Constructor. More...
 
bool is_null () const
 Check if this cell is NULL. More...
 
uint32_t data_length () const
 Get the length of the user data. More...
 
const unsigned char * data () const
 Get a pointer to the user data inside the row. More...
 

Private Attributes

const bool m_is_null
 Designate whether the cell is NULL. More...
 
const uint32_t m_data_length
 Length of the user data pointed by m_data in bytes. More...
 
const unsigned char *const m_data
 User data. More...
 

Detailed Description

A cell is the intersection of a row and a column.

In the handler interface row format (what is provided to the write_row() handler method) a cell may occupy too much space - in the case of a VARCHAR(N) column it will occupy N bytes, even if a shorter string is stored in this particular cell. So, our cell is derived from the above, but does not occupy unnecessary space.

This class is just an interpreter - it does not store the actual data, which is stored in the Row class, allocated at once for all the cells of a row.

Constructor & Destructor Documentation

◆ Cell()

temptable::Cell::Cell ( bool  is_null,
uint32_t  data_length,
const unsigned char *  data 
)
inline

Constructor.

Parameters
[in]is_nullDesignate whether this cell is NULL.
[in]data_lengthLength of the user data in bytes (no metadata or any leading bytes to designate the length. Just the user data.
[in]dataPointer to the user data. It is not copied inside this newly created Cell object, so it must remain valid for the lifetime of this object.

Member Function Documentation

◆ data()

const unsigned char * temptable::Cell::data ( ) const
inline

Get a pointer to the user data inside the row.

Returns
a pointer

◆ data_length()

uint32_t temptable::Cell::data_length ( ) const
inline

Get the length of the user data.

Returns
length in bytes

◆ is_null()

bool temptable::Cell::is_null ( ) const
inline

Check if this cell is NULL.

Returns
true if NULL

Member Data Documentation

◆ m_data

const unsigned char* const temptable::Cell::m_data
private

User data.

◆ m_data_length

const uint32_t temptable::Cell::m_data_length
private

Length of the user data pointed by m_data in bytes.

◆ m_is_null

const bool temptable::Cell::m_is_null
private

Designate whether the cell is NULL.


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