MySQL 26.7.0
Source Code Documentation
Column_mysql Struct Reference

#include <bulk_data_service.h>

Public Member Functions

char * get_data () const
 Get the column data. More...
 
void set_data (char *ptr)
 Set the column data to the given pointer location. More...
 
void set_ext ()
 Mark this column as externally stored. More...
 
bool is_ext () const
 Check if the column is externally stored. More...
 
void row (char *row_begin)
 Save the beginning of the row pointer in this object. More...
 
char * get_row_begin (const Row_meta &row_meta, size_t col_index) const
 Get the pointer to the beginning of row. More...
 
void init ()
 
std::string to_string () const
 

Public Attributes

int16_t m_type {}
 Column Data Type. More...
 
uint16_t m_data_len {}
 Column data length. More...
 
bool m_is_prefix {false}
 
bool m_is_null {false}
 If column is NULL. More...
 
bool m_is_ext {false}
 If true, the column data is stored externally in InnoDB. More...
 
uint64_t m_int_data
 Column data in integer format. More...
 

Private Attributes

char * m_data_ptr {nullptr}
 Column data or row begin. More...
 

Member Function Documentation

◆ get_data()

char * Column_mysql::get_data ( ) const
inline

Get the column data.

Returns
nullptr if column is null, otherwise pointer to the data.

◆ get_row_begin()

char * Column_mysql::get_row_begin ( const Row_meta row_meta,
size_t  col_index 
) const
inline

Get the pointer to the beginning of row.

This is valid only if the column is null. This should be called on the first column of the row. There is no need to call this on other columns.

Parameters
[in]row_metameta data information about the row
[in]col_indexIndex of the first column which is 0.
Returns
pointer to row beginning.

◆ init()

void Column_mysql::init ( )
inline

◆ is_ext()

bool Column_mysql::is_ext ( ) const
inline

Check if the column is externally stored.

Returns
true if externally stored, false otherwise.

◆ row()

void Column_mysql::row ( char *  row_begin)
inline

Save the beginning of the row pointer in this object.

This should be called only when the column is null.

Parameters
[in]row_beginpointer to beginning of row.

◆ set_data()

void Column_mysql::set_data ( char *  ptr)
inline

Set the column data to the given pointer location.

Parameters
[in]ptrpointer pointing to column data.

◆ set_ext()

void Column_mysql::set_ext ( )
inline

Mark this column as externally stored.

◆ to_string()

std::string Column_mysql::to_string ( ) const
inline

Member Data Documentation

◆ m_data_len

uint16_t Column_mysql::m_data_len {}

Column data length.

◆ m_data_ptr

char* Column_mysql::m_data_ptr {nullptr}
private

Column data or row begin.

There is a need to fetch the beginning of the row from the vector of Column_mysql. But in the case of secondary indexes, all the keys could be null and it becomes impossible to obtain the pointer to beginning of the row. To solve this problem, I am re-using this pointer to hold the row begin when the column is null. So it becomes important to make use of m_is_null to check if the column is null. It is NOT correct to check this pointer against nullptr to confirm if column is null.

◆ m_int_data

uint64_t Column_mysql::m_int_data

Column data in integer format.

Used only for specific datatype.

◆ m_is_ext

bool Column_mysql::m_is_ext {false}

If true, the column data is stored externally in InnoDB.

It also means that the data contains blob reference of length BTR_EXTERN_FIELD_REF_SIZE bytes at the end.

◆ m_is_null

bool Column_mysql::m_is_null {false}

If column is NULL.

◆ m_is_prefix

bool Column_mysql::m_is_prefix {false}

◆ m_type

int16_t Column_mysql::m_type {}

Column Data Type.


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