27#ifndef TEMPTABLE_CELL_CALCULATOR_H
28#define TEMPTABLE_CELL_CALCULATOR_H
58 const Field *mysql_field);
64 const Cell &cell)
const;
74 const Cell &rhs)
const;
77 enum class Mode : uint8_t {
105 : m_mysql_field(mysql_key_part.field),
106 m_cs(field_charset(*m_mysql_field)),
111 if (
m_cs !=
nullptr) {
118 if (use_char_length) {
130 : m_mysql_field(mysql_field),
131 m_cs(field_charset(*m_mysql_field)),
138 if (
m_cs !=
nullptr) {
178 auto data = cell.
data();
204 std::min(
static_cast<size_t>(data_length),
245 if ((lhs_data_length == rhs_data_length) &&
246 ((lhs_data_length == 0) ||
247 (memcmp(lhs.
data(), rhs.
data(), lhs_data_length) == 0))) {
251 auto lhs_data = lhs.
data();
252 auto rhs_data = rhs.
data();
254 size_t lhs_length = 0;
255 size_t rhs_length = 0;
262 lhs_length = lhs_data_length;
263 rhs_length = rhs_data_length;
265 lhs_length = std::min(
266 static_cast<size_t>(lhs_data_length),
268 rhs_length = std::min(
269 static_cast<size_t>(rhs_data_length),
280 m_cs,
reinterpret_cast<const char *
>(lhs_data), lhs_length);
282 m_cs,
reinterpret_cast<const char *
>(rhs_data), rhs_length);
TempTable Cell declaration.
const CHARSET_INFO * charset_for_protocol() const
Definition: field.h:1595
virtual enum ha_base_keytype key_type() const
Definition: field.h:1162
bool is_flag_set(unsigned flag) const
Definition: field.h:749
uint16 length
Definition: key.h:63
uint16 key_part_flag
Definition: key.h:72
Utility to perform calculations for a cell.
Definition: cell_calculator.h:44
static const CHARSET_INFO * field_charset(const Field &field)
Definition: cell_calculator.h:145
uint32_t m_char_length
Length in number of characters.
Definition: cell_calculator.h:99
Mode m_mode
Calculation mode.
Definition: cell_calculator.h:92
Cell_calculator()=default
Default constructor used for std::array initialization in Index.
Mode
Definition: cell_calculator.h:77
@ CHARSET_AND_CHAR_LENGTH
size_t hash(const Cell &cell) const
Calculate hash value for a cell.
Definition: cell_calculator.h:164
const CHARSET_INFO * m_cs
Charset used by calculator.
Definition: cell_calculator.h:89
const Field * m_mysql_field
Field for which this calculator was created.
Definition: cell_calculator.h:86
bool m_is_space_padded
True if the cell is right-padded with spaces (CHAR column).
Definition: cell_calculator.h:95
int compare(const Cell &lhs, const Cell &rhs) const
Compare two cells.
Definition: cell_calculator.h:223
A cell is the intersection of a row and a column.
Definition: cell.h:42
const unsigned char * data() const
Get a pointer to the user data inside the row.
Definition: cell.h:88
bool is_null() const
Check if this cell is NULL.
Definition: cell.h:84
uint32_t data_length() const
Get the length of the user data.
Definition: cell.h:86
#define ENUM_FLAG
field is an enum
Definition: mysql_com.h:164
#define SET_FLAG
field is a set
Definition: mysql_com.h:167
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
Compare key in record buffer to a given key.
Definition: key.cc:453
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:511
#define my_charpos(cs, b, e, num)
Definition: m_ctype.h:719
@ NO_PAD
Definition: m_ctype.h:198
@ HA_KEYTYPE_VARBINARY2
Definition: my_base.h:460
@ HA_KEYTYPE_VARTEXT2
Definition: my_base.h:459
@ HA_KEYTYPE_VARTEXT1
Definition: my_base.h:456
@ HA_KEYTYPE_VARBINARY1
Definition: my_base.h:457
@ HA_KEYTYPE_TEXT
Definition: my_base.h:441
#define HA_PART_KEY_SEG
Definition: my_base.h:562
#define DBUG_EXECUTE_IF(keyword, a1)
Definition: my_dbug.h:171
void my_abort()
Calls our own implementation of abort, if specified, or std's abort().
Definition: my_init.cc:258
uint64_t uint64
Definition: my_inttypes.h:69
uint32 murmur3_32(const uchar *key, size_t len, uint32 seed)
Compute 32-bit version of MurmurHash3 hash for the key.
Definition: my_murmur3.cc:86
int key_type
Definition: http_request.h:50
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Definition: allocator.h:45
Definition: m_ctype.h:385
uint mbmaxlen
Definition: m_ctype.h:409
MY_COLLATION_HANDLER * coll
Definition: m_ctype.h:418
MY_CHARSET_HANDLER * cset
Definition: m_ctype.h:417
enum Pad_attribute pad_attribute
If this collation is PAD_SPACE, it collates as if all inputs were padded with a given number of space...
Definition: m_ctype.h:427
size_t(* lengthsp)(const CHARSET_INFO *, const char *ptr, size_t length)
Given a pointer and a length in bytes, returns a new length in bytes where all trailing space charact...
Definition: m_ctype.h:333
void(* hash_sort)(const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2)
Compute a sort hash for the given key.
Definition: m_ctype.h:282
int(* strnncollsp)(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t)
Compare the two strings under the pad rules given by the collation.
Definition: m_ctype.h:216