MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbSqlUtil Class Reference

#include <NdbSqlUtil.hpp>

Classes

struct  Type

Public Types

typedef int Cmp (const void *info, const void *p1, uint n1, const void *p2, uint n2)
typedef int Like (const void *info, const void *p1, unsigned n1, const void *p2, unsigned n2)
typedef int AndMask (const void *data, unsigned dataLen, const void *mask, unsigned maskLen, bool cmpZero)

Static Public Member Functions

static const TypegetType (Uint32 typeId)
static uint check_column_for_pk (Uint32 typeId, const void *info)
static uint check_column_for_hash_index (Uint32 typeId, const void *info)
static uint check_column_for_ordered_index (Uint32 typeId, const void *info)
static bool get_var_length (Uint32 typeId, const void *p, unsigned attrlen, Uint32 &lb, Uint32 &len)
static int strnxfrm_bug7284 (CHARSET_INFO *cs, unsigned char *dst, unsigned dstLen, const unsigned char *src, unsigned srcLen)
static size_t ndb_strnxfrm (struct charset_info_st *cs, uchar *dst, size_t dstlen, const uchar *src, size_t srclen)
static void convertByteOrder (Uint32 typeId, Uint32 typeLog2Size, Uint32 arrayType, Uint32 arraySize, uchar *data, Uint32 dataByteSize)

Friends

class NdbPack

Detailed Description

Helper class with comparison functions on NDB (column) data types.

Notes: this Helper class

  • is used by kernel code
  • provides non-elementary functions
  • is not generic, template-based code
  • has link/library dependencies upon MySQL code (in contrast to other type utility classes, like ./NdbTypesUtil).

Definition at line 37 of file NdbSqlUtil.hpp.

Member Typedef Documentation

typedef int NdbSqlUtil::AndMask(const void *data, unsigned dataLen, const void *mask, unsigned maskLen, bool cmpZero)

Prototype for mask comparisons. Defined for bit type.

If common portion of data AND Mask is equal to mask return 0, else return 1. If cmpZero, compare data AND Mask to zero.

Definition at line 69 of file NdbSqlUtil.hpp.

typedef int NdbSqlUtil::Cmp(const void *info, const void *p1, uint n1, const void *p2, uint n2)

Compare attribute values. Returns negative, zero, positive for less, equal, greater. We trust DBTUP to validate all data and mysql upgrade to not invalidate them. Bad values (such as NaN) causing undefined results crash here always (require, not assert) since they are likely to cause a more obscure crash in DBTUX. wl4163_todo: API probably should not crash.

Parameters are pointers to values (no alignment requirements) and their lengths in bytes. First parameter is a pointer to type specific extra info. Char types receive CHARSET_INFO in it.

Definition at line 51 of file NdbSqlUtil.hpp.

typedef int NdbSqlUtil::Like(const void *info, const void *p1, unsigned n1, const void *p2, unsigned n2)

Prototype for "like" comparison. Defined for string types. First argument can be fixed or var* type, second argument is fixed. Returns 0 on match, +1 on no match, and -1 on bad data.

Uses default special chars ( \ % _ ).

Definition at line 60 of file NdbSqlUtil.hpp.

Member Function Documentation

uint NdbSqlUtil::check_column_for_pk ( Uint32  typeId,
const void *  info 
)
static

Check character set.

Definition at line 844 of file NdbSqlUtil.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NdbSqlUtil::convertByteOrder ( Uint32  typeId,
Uint32  typeLog2Size,
Uint32  arrayType,
Uint32  arraySize,
uchar *  data,
Uint32  dataByteSize 
)
static

Convert attribute data to/from network byte order This method converts the passed data of the passed type between host and network byte order. On little-endian (network order) hosts, it has no effect.

Convert attribute byte order if necessary

Definition at line 1152 of file NdbSqlUtil.cpp.

Here is the caller graph for this function:

bool NdbSqlUtil::get_var_length ( Uint32  typeId,
const void *  p,
unsigned  attrlen,
Uint32 &  lb,
Uint32 &  len 
)
static

Get number of length bytes and length from variable length string. Returns false on error (invalid data). For other types returns zero length bytes and the fixed attribute length.

Definition at line 917 of file NdbSqlUtil.cpp.

Here is the caller graph for this function:

const NdbSqlUtil::Type & NdbSqlUtil::getType ( Uint32  typeId)
static

Get type by id. Can return the Undefined type.

Definition at line 217 of file NdbSqlUtil.cpp.

Here is the caller graph for this function:

size_t NdbSqlUtil::ndb_strnxfrm ( struct charset_info_st cs,
uchar *  dst,
size_t  dstlen,
const uchar *  src,
size_t  srclen 
)
static

Wrapper for 'strnxfrm' who change prototype in 5.6

Definition at line 950 of file NdbSqlUtil.cpp.

Here is the caller graph for this function:

int NdbSqlUtil::strnxfrm_bug7284 ( CHARSET_INFO cs,
unsigned char *  dst,
unsigned  dstLen,
const unsigned char *  src,
unsigned  srcLen 
)
static

Temporary workaround for bug#7284.

Definition at line 970 of file NdbSqlUtil.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: