MySQL 8.0.39
Source Code Documentation
|
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... | |
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.
|
inline |
Constructor.
[in] | is_null | Designate whether this cell is NULL. |
[in] | data_length | Length of the user data in bytes (no metadata or any leading bytes to designate the length. Just the user data. |
[in] | data | Pointer 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. |
|
inline |
Get a pointer to the user data inside the row.
|
inline |
Get the length of the user data.
|
inline |
Check if this cell is NULL.
|
private |
User data.
|
private |
Length of the user data pointed by m_data
in bytes.
|
private |
Designate whether the cell is NULL.