MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Column_mysql Struct Reference

#include <bulk_data_service.h>

Public Member Functions

char * get_data () const
 
void set_data (char *ptr)
 
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_null {false}
 If column is NULL. 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_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

◆ 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

◆ 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_null

bool Column_mysql::m_is_null {false}

If column is NULL.

◆ m_type

int16_t Column_mysql::m_type {}

Column Data Type.


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