MySQL 8.0.39
Source Code Documentation
|
Utility to perform calculations for a cell. More...
#include <cell_calculator.h>
Public Member Functions | |
Cell_calculator ()=default | |
Default constructor used for std::array initialization in Index. More... | |
Cell_calculator (const KEY_PART_INFO &mysql_key_part) | |
Constructor to be used when creating calculators for indexed columns. More... | |
Cell_calculator (const Field *mysql_field) | |
Constructor to be used when creating calculators for columns when comparing table rows. More... | |
size_t | hash (const Cell &cell) const |
Calculate hash value for a cell. More... | |
int | compare (const Cell &lhs, const Cell &rhs) const |
Compare two cells. More... | |
Private Types | |
enum class | Mode : uint8_t { BINARY , CHARSET , CHARSET_AND_CHAR_LENGTH } |
Static Private Member Functions | |
static const CHARSET_INFO * | field_charset (const Field &field) |
Private Attributes | |
const Field * | m_mysql_field |
Field for which this calculator was created. More... | |
const CHARSET_INFO * | m_cs |
Charset used by calculator. More... | |
Mode | m_mode |
Calculation mode. More... | |
bool | m_is_space_padded |
True if the cell is right-padded with spaces (CHAR column). More... | |
uint32_t | m_char_length |
Length in number of characters. More... | |
Utility to perform calculations for a cell.
It uses cell's contents and a stored context that describes how to interpret the data.
|
strongprivate |
|
default |
Default constructor used for std::array initialization in Index.
|
inlineexplicit |
Constructor to be used when creating calculators for indexed columns.
[in] | mysql_key_part | Key part (indexed column) for which calculator is created. |
|
inlineexplicit |
Constructor to be used when creating calculators for columns when comparing table rows.
[in] | mysql_field | Field (column) for which calculator is created. |
Compare two cells.
<0 | if lhs < rhs |
0 | if lhs == rhs |
>0 | if lhs > rhs |
[in] | lhs | First cell to compare. |
[in] | rhs | Second cell to compare. |
|
inlinestaticprivate |
|
inline |
Calculate hash value for a cell.
[in] | cell | Cell for which hash is to be calculated. |
|
private |
Length in number of characters.
Only used in CHARSET_AND_CHAR_LENGTH mode.
|
private |
Charset used by calculator.
NULL for binary mode.
|
private |
True if the cell is right-padded with spaces (CHAR column).
|
private |
Calculation mode.
|
private |
Field for which this calculator was created.