MySQL 8.4.2
Source Code Documentation
my_compare.h File Reference
#include <sys/types.h>
#include "my_inttypes.h"
#include "myisampack.h"
#include "mysql/strings/m_ctype.h"

Go to the source code of this file.

Classes

struct  HA_KEYSEG
 

Macros

#define HA_MAX_POSSIBLE_KEY   255 /* For myisamchk */
 
#define HA_MAX_KEY_LENGTH   1000 /* Max length in bytes */
 
#define HA_MAX_KEY_SEG   16 /* Max segments for key */
 
#define HA_MAX_POSSIBLE_KEY_BUFF   (HA_MAX_KEY_LENGTH + 24 + 6 + 6)
 
#define HA_MAX_KEY_BUFF   (HA_MAX_KEY_LENGTH + HA_MAX_KEY_SEG * 6 + 8 + 8)
 
#define store_key_length_inc(key, length)
 
#define size_to_store_key_length(length)   ((length) < 255 ? 1 : 3)
 
#define get_rec_bits(bit_ptr, bit_ofs, bit_len)
 
#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len)
 
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len)    set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
 

Functions

static uint get_key_length (const uchar **key)
 
static uint get_key_pack_length (const uchar **key, uint *length_pack)
 
int ha_compare_text (const CHARSET_INFO *, const uchar *, uint, const uchar *, uint, bool)
 
int ha_key_cmp (const HA_KEYSEG *keyseg, const uchar *a, const uchar *b, uint key_length, uint nextflag, uint *diff_pos)
 
template<class T >
int compare_numbers (T val1, T val2)
 Compare two numbers of the same type. More...
 

Macro Definition Documentation

◆ clr_rec_bits

#define clr_rec_bits (   bit_ptr,
  bit_ofs,
  bit_len 
)     set_rec_bits(0, bit_ptr, bit_ofs, bit_len)

◆ get_rec_bits

#define get_rec_bits (   bit_ptr,
  bit_ofs,
  bit_len 
)
Value:
(((((uint16)(bit_ptr)[1] << 8) | (uint16)(bit_ptr)[0]) >> (bit_ofs)) & \
((1 << (bit_len)) - 1))
uint16_t uint16
Definition: my_inttypes.h:65

◆ HA_MAX_KEY_BUFF

#define HA_MAX_KEY_BUFF   (HA_MAX_KEY_LENGTH + HA_MAX_KEY_SEG * 6 + 8 + 8)

◆ HA_MAX_KEY_LENGTH

#define HA_MAX_KEY_LENGTH   1000 /* Max length in bytes */

◆ HA_MAX_KEY_SEG

#define HA_MAX_KEY_SEG   16 /* Max segments for key */

◆ HA_MAX_POSSIBLE_KEY

#define HA_MAX_POSSIBLE_KEY   255 /* For myisamchk */

◆ HA_MAX_POSSIBLE_KEY_BUFF

#define HA_MAX_POSSIBLE_KEY_BUFF   (HA_MAX_KEY_LENGTH + 24 + 6 + 6)

◆ set_rec_bits

#define set_rec_bits (   bits,
  bit_ptr,
  bit_ofs,
  bit_len 
)
Value:
{ \
(bit_ptr)[0] = ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
((bits) << (bit_ofs)); \
if ((bit_ofs) + (bit_len) > 8) \
(bit_ptr)[1] = \
((bit_ptr)[1] & ~((1 << ((bit_len)-8 + (bit_ofs))) - 1)) | \
((bits) >> (8 - (bit_ofs))); \
}

◆ size_to_store_key_length

#define size_to_store_key_length (   length)    ((length) < 255 ? 1 : 3)

◆ store_key_length_inc

#define store_key_length_inc (   key,
  length 
)
Value:
{ \
if ((length) < 255) { \
*(key)++ = (length); \
} else { \
*(key) = 255; \
mi_int2store((key) + 1, (length)); \
(key) += 3; \
} \
}
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
required string key
Definition: replication_asynchronous_connection_failover.proto:60

Function Documentation

◆ compare_numbers()

template<class T >
int compare_numbers ( val1,
val2 
)

Compare two numbers of the same type.

Parameters
val1the first number
val2the second number
Return values
-1if val1 is less than val2,
0if val1 is equal to val2,
1if val1 is greater than val2

◆ get_key_length()

static uint get_key_length ( const uchar **  key)
inlinestatic

◆ get_key_pack_length()

static uint get_key_pack_length ( const uchar **  key,
uint *  length_pack 
)
inlinestatic

◆ ha_compare_text()

int ha_compare_text ( const CHARSET_INFO charset_info,
const uchar a,
uint  a_length,
const uchar b,
uint  b_length,
bool  part_key 
)

◆ ha_key_cmp()

int ha_key_cmp ( const HA_KEYSEG keyseg,
const uchar a,
const uchar b,
uint  key_length,
uint  nextflag,
uint *  diff_pos 
)