MySQL  8.0.19
Source Code Documentation
data0type.h File Reference
#include "univ.i"
#include "data0type.ic"

Go to the source code of this file.

Classes

struct  dtype_t
 

Macros

#define DATA_MYSQL_BINARY_CHARSET_COLL   63
 
#define DATA_MISSING   0 /* missing column */
 
#define DATA_VARCHAR
 
#define DATA_CHAR
 
#define DATA_FIXBINARY   3 /* binary string of fixed length */
 
#define DATA_BINARY   4 /* binary string */
 
#define DATA_BLOB
 
#define DATA_INT   6 /* integer: can be any size 1 - 8 bytes */
 
#define DATA_SYS_CHILD   7 /* address of the child page in node pointer */
 
#define DATA_SYS   8 /* system column */
 
#define DATA_FLOAT   9
 
#define DATA_DOUBLE   10
 
#define DATA_DECIMAL   11 /* decimal number stored as an ASCII string */
 
#define DATA_VARMYSQL   12 /* any charset varying length char */
 
#define DATA_MYSQL   13 /* any charset fixed length char */
 
#define DATA_GEOMETRY   14 /* geometry datatype of variable length */
 
#define DATA_POINT   15 /* geometry datatype of fixed length POINT */
 
#define DATA_VAR_POINT
 
#define DATA_MTYPE_MAX
 
#define DATA_MTYPE_CURRENT_MIN   DATA_VARCHAR /* minimum value of mtype */
 
#define DATA_MTYPE_CURRENT_MAX   DATA_VAR_POINT /* maximum value of mtype */
 
#define DATA_ENGLISH
 
#define DATA_ERROR   111 /* another relic from pre-MySQL time */
 
#define DATA_MYSQL_TYPE_MASK
 
#define DATA_MYSQL_TRUE_VARCHAR
 
#define DATA_ROW_ID   0 /* row id: a 48-bit integer */
 
#define DATA_ROW_ID_LEN   6 /* stored length for row id */
 
#define DATA_N_SYS_COLS   3 /* number of system columns defined above */
 
#define DATA_ITT_N_SYS_COLS   2
 
#define DATA_FTS_DOC_ID   3 /* Used as FTS DOC ID column */
 
#define DATA_SYS_PRTYPE_MASK   0xF /* mask to extract the above from prtype */
 
#define DATA_NOT_NULL
 
#define DATA_UNSIGNED
 
#define DATA_BINARY_TYPE
 
#define DATA_GIS_MBR   2048 /* Used as GIS MBR column */
 
#define DATA_MBR_LEN   SPDIMS * 2 * sizeof(double) /* GIS MBR length*/
 
#define DATA_LONG_TRUE_VARCHAR
 
#define DATA_VIRTUAL   8192 /* Virtual column */
 
#define DATA_MULTI_VALUE   16384 /* Multi-value Virtual column */
 
#define DATA_ORDER_NULL_TYPE_BUF_SIZE   4
 
#define DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE   6
 
#define DATA_MBMAX   5
 
#define DATA_POINT_LEN   25
 
#define DATA_MBMINMAXLEN(mbminlen, mbmaxlen)   ((mbmaxlen)*DATA_MBMAX + (mbminlen))
 
#define DATA_MBMINLEN(mbminmaxlen)   ((ulint)UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), 1))
 
#define DATA_MBMAXLEN(mbminmaxlen)   ((ulint)((mbminmaxlen) / DATA_MBMAX))
 
#define DATA_POINT_MTYPE(mtype)   ((mtype) == DATA_POINT || (mtype) == DATA_VAR_POINT)
 
#define DATA_GEOMETRY_MTYPE(mtype)   (DATA_POINT_MTYPE(mtype) || (mtype) == DATA_GEOMETRY)
 
#define DATA_LARGE_MTYPE(mtype)
 
#define DATA_BIG_LEN_MTYPE(len, mtype)   ((len) > 255 || DATA_LARGE_MTYPE(mtype))
 
#define DATA_BIG_COL(col)   DATA_BIG_LEN_MTYPE((col)->len, (col)->mtype)
 
#define DATA_LARGE_BINARY(mtype, prtype)
 
#define MAX_CHAR_COLL_NUM   32767
 
#define CHAR_COLL_MASK   MAX_CHAR_COLL_NUM
 

Enumerations

enum  ib_like_t { IB_LIKE_EXACT, IB_LIKE_PREFIX }
 SQL Like operator comparison types. More...
 

Functions

UNIV_INLINE ulint dtype_get_mysql_type (const dtype_t *type)
 Gets the MySQL type code from a dtype. More...
 
ulint dtype_get_at_most_n_mbchars (ulint prtype, ulint mbminmaxlen, ulint prefix_len, ulint data_len, const char *str)
 Determine how many bytes the first n characters of the given string occupy. More...
 
ibool dtype_is_string_type (ulint mtype)
 Checks if a data main type is a string type. More...
 
ibool dtype_is_binary_string_type (ulint mtype, ulint prtype)
 Checks if a type is a binary string type. More...
 
ibool dtype_is_non_binary_string_type (ulint mtype, ulint prtype)
 Checks if a type is a non-binary string type. More...
 
UNIV_INLINE void dtype_set (dtype_t *type, ulint mtype, ulint prtype, ulint len)
 Sets a data type structure. More...
 
UNIV_INLINE void dtype_copy (dtype_t *type1, const dtype_t *type2)
 Copies a data type structure. More...
 
UNIV_INLINE ulint dtype_get_mtype (const dtype_t *type)
 Gets the SQL main data type. More...
 
UNIV_INLINE ulint dtype_get_prtype (const dtype_t *type)
 Gets the precise data type. More...
 
UNIV_INLINE void dtype_get_mblen (ulint mtype, ulint prtype, ulint *mbminlen, ulint *mbmaxlen)
 Compute the mbminlen and mbmaxlen members of a data type structure. More...
 
UNIV_INLINE ulint dtype_get_charset_coll (ulint prtype)
 Gets the MySQL charset-collation code for MySQL string types. More...
 
ulint dtype_form_prtype (ulint old_prtype, ulint charset_coll)
 Forms a precise type from the < 4.1.2 format precise type plus the charset-collation code. More...
 
UNIV_INLINE ibool dtype_is_utf8 (ulint prtype)
 Determines if a MySQL string type is a subset of UTF-8. More...
 
UNIV_INLINE ulint dtype_get_len (const dtype_t *type)
 Gets the type length. More...
 
UNIV_INLINE ulint dtype_get_mbminlen (const dtype_t *type)
 Gets the minimum length of a character, in bytes. More...
 
UNIV_INLINE ulint dtype_get_mbmaxlen (const dtype_t *type)
 Gets the maximum length of a character, in bytes. More...
 
UNIV_INLINE void dtype_set_mbminmaxlen (dtype_t *type, ulint mbminlen, ulint mbmaxlen)
 Sets the minimum and maximum length of a character, in bytes. More...
 
UNIV_INLINE ulint dtype_get_fixed_size_low (ulint mtype, ulint prtype, ulint len, ulint mbminmaxlen, ulint comp)
 Returns the size of a fixed size data type, 0 if not a fixed size type. More...
 
UNIV_INLINE ulint dtype_get_min_size_low (ulint mtype, ulint prtype, ulint len, ulint mbminmaxlen)
 Returns the minimum size of a data type. More...
 
UNIV_INLINE ulint dtype_get_max_size_low (ulint mtype, ulint len)
 Returns the maximum size of a data type. More...
 
UNIV_INLINE ulint dtype_get_sql_null_size (const dtype_t *type, ulint comp)
 Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a type. More...
 
UNIV_INLINE void dtype_read_for_order_and_null_size (dtype_t *type, const byte *buf)
 Reads to a type the stored information which determines its alphabetical ordering and the storage size of an SQL NULL value. More...
 
UNIV_INLINE void dtype_new_store_for_order_and_null_size (byte *buf, const dtype_t *type, ulint prefix_len)
 Stores for a type the information which determines its alphabetical ordering and the storage size of an SQL NULL value. More...
 
UNIV_INLINE void dtype_new_read_for_order_and_null_size (dtype_t *type, const byte *buf)
 Reads to a type the stored information which determines its alphabetical ordering and the storage size of an SQL NULL value. More...
 
UNIV_INLINE char * dtype_sql_name (unsigned mtype, unsigned prtype, unsigned len, char *name, unsigned name_sz)
 Returns the type's SQL name (e.g. More...
 
ibool dtype_validate (const dtype_t *type)
 Validates a data type structure. More...
 
void dtype_print (const dtype_t *type)
 Print a data type structure. More...
 
std::ostream & operator<< (std::ostream &out, const dtype_t &obj)
 

Variables

ulint data_mysql_default_charset_coll
 
constexpr size_t DATA_TRX_ID = 1
 Transaction id: 6 bytes. More...
 
constexpr size_t DATA_TRX_ID_LEN = 6
 Transaction ID type size in bytes. More...
 
constexpr size_t DATA_ROLL_PTR = 2
 Rollback data pointer: 7 bytes. More...
 
constexpr size_t DATA_ROLL_PTR_LEN = 7
 Rollback data pointer type size in bytes. More...
 

Detailed Description

Data types

Created 1/16/1996 Heikki Tuuri

Macro Definition Documentation

◆ CHAR_COLL_MASK

#define CHAR_COLL_MASK   MAX_CHAR_COLL_NUM

◆ DATA_BIG_COL

#define DATA_BIG_COL (   col)    DATA_BIG_LEN_MTYPE((col)->len, (col)->mtype)

◆ DATA_BIG_LEN_MTYPE

#define DATA_BIG_LEN_MTYPE (   len,
  mtype 
)    ((len) > 255 || DATA_LARGE_MTYPE(mtype))

◆ DATA_BINARY

#define DATA_BINARY   4 /* binary string */

◆ DATA_BINARY_TYPE

#define DATA_BINARY_TYPE
Value:
1024 /* if the data type is a binary character \
string, this is ORed to the precise type: \
this only holds for tables created with \
>= MySQL-4.0.14 */

◆ DATA_BLOB

#define DATA_BLOB
Value:
5 /* binary large object, or a TEXT type; \
if prtype & DATA_BINARY_TYPE == 0, then this is \
actually a TEXT column (or a BLOB created \
with < 4.0.14; since column prefix indexes \
came only in 4.0.14, the missing flag in BLOBs \
created before that does not cause any harm) */

◆ DATA_CHAR

#define DATA_CHAR
Value:
2 /* fixed length character of the \
latin1_swedish_ci charset-collation */

◆ DATA_DECIMAL

#define DATA_DECIMAL   11 /* decimal number stored as an ASCII string */

◆ DATA_DOUBLE

#define DATA_DOUBLE   10

◆ DATA_ENGLISH

#define DATA_ENGLISH
Value:
4 /* English language character string: this \
is a relic from pre-MySQL time and only used \
for InnoDB's own system tables */

◆ DATA_ERROR

#define DATA_ERROR   111 /* another relic from pre-MySQL time */

◆ DATA_FIXBINARY

#define DATA_FIXBINARY   3 /* binary string of fixed length */

◆ DATA_FLOAT

#define DATA_FLOAT   9

◆ DATA_FTS_DOC_ID

#define DATA_FTS_DOC_ID   3 /* Used as FTS DOC ID column */

◆ DATA_GEOMETRY

#define DATA_GEOMETRY   14 /* geometry datatype of variable length */

◆ DATA_GEOMETRY_MTYPE

#define DATA_GEOMETRY_MTYPE (   mtype)    (DATA_POINT_MTYPE(mtype) || (mtype) == DATA_GEOMETRY)

◆ DATA_GIS_MBR

#define DATA_GIS_MBR   2048 /* Used as GIS MBR column */

◆ DATA_INT

#define DATA_INT   6 /* integer: can be any size 1 - 8 bytes */

◆ DATA_ITT_N_SYS_COLS

#define DATA_ITT_N_SYS_COLS   2

◆ DATA_LARGE_BINARY

#define DATA_LARGE_BINARY (   mtype,
  prtype 
)
Value:
((mtype) == DATA_GEOMETRY || \
((mtype) == DATA_BLOB && !((prtype)&DATA_BINARY_TYPE)))

◆ DATA_LARGE_MTYPE

#define DATA_LARGE_MTYPE (   mtype)
Value:
((mtype) == DATA_BLOB || (mtype) == DATA_VAR_POINT || \
(mtype) == DATA_GEOMETRY)

◆ DATA_LONG_TRUE_VARCHAR

#define DATA_LONG_TRUE_VARCHAR
Value:
4096 /* this is ORed to the precise data \
type when the column is true VARCHAR where \
MySQL uses 2 bytes to store the data len; \
for shorter VARCHARs MySQL uses only 1 byte */

◆ DATA_MBMAX

#define DATA_MBMAX   5

◆ DATA_MBMAXLEN

#define DATA_MBMAXLEN (   mbminmaxlen)    ((ulint)((mbminmaxlen) / DATA_MBMAX))

◆ DATA_MBMINLEN

#define DATA_MBMINLEN (   mbminmaxlen)    ((ulint)UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), 1))

◆ DATA_MBMINMAXLEN

#define DATA_MBMINMAXLEN (   mbminlen,
  mbmaxlen 
)    ((mbmaxlen)*DATA_MBMAX + (mbminlen))

◆ DATA_MBR_LEN

#define DATA_MBR_LEN   SPDIMS * 2 * sizeof(double) /* GIS MBR length*/

◆ DATA_MISSING

#define DATA_MISSING   0 /* missing column */

◆ DATA_MTYPE_CURRENT_MAX

#define DATA_MTYPE_CURRENT_MAX   DATA_VAR_POINT /* maximum value of mtype */

◆ DATA_MTYPE_CURRENT_MIN

#define DATA_MTYPE_CURRENT_MIN   DATA_VARCHAR /* minimum value of mtype */

◆ DATA_MTYPE_MAX

#define DATA_MTYPE_MAX
Value:
63 /* dtype_store_for_order_and_null_size() \
requires the values are <= 63 */

◆ DATA_MULTI_VALUE

#define DATA_MULTI_VALUE   16384 /* Multi-value Virtual column */

◆ DATA_MYSQL

#define DATA_MYSQL   13 /* any charset fixed length char */

◆ DATA_MYSQL_BINARY_CHARSET_COLL

#define DATA_MYSQL_BINARY_CHARSET_COLL   63

◆ DATA_MYSQL_TRUE_VARCHAR

#define DATA_MYSQL_TRUE_VARCHAR
Value:
15 /* MySQL type code for the >= 5.0.3 \
format true VARCHAR */

◆ DATA_MYSQL_TYPE_MASK

#define DATA_MYSQL_TYPE_MASK
Value:
255 /* AND with this mask to extract the MySQL \
type from the precise type */

◆ DATA_N_SYS_COLS

#define DATA_N_SYS_COLS   3 /* number of system columns defined above */

◆ DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE

#define DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE   6

◆ DATA_NOT_NULL

#define DATA_NOT_NULL
Value:
256 /* this is ORed to the precise type when \
the column is declared as NOT NULL */

◆ DATA_ORDER_NULL_TYPE_BUF_SIZE

#define DATA_ORDER_NULL_TYPE_BUF_SIZE   4

◆ DATA_POINT

#define DATA_POINT   15 /* geometry datatype of fixed length POINT */

◆ DATA_POINT_LEN

#define DATA_POINT_LEN   25

◆ DATA_POINT_MTYPE

#define DATA_POINT_MTYPE (   mtype)    ((mtype) == DATA_POINT || (mtype) == DATA_VAR_POINT)

◆ DATA_ROW_ID

#define DATA_ROW_ID   0 /* row id: a 48-bit integer */

◆ DATA_ROW_ID_LEN

#define DATA_ROW_ID_LEN   6 /* stored length for row id */

◆ DATA_SYS

#define DATA_SYS   8 /* system column */

◆ DATA_SYS_CHILD

#define DATA_SYS_CHILD   7 /* address of the child page in node pointer */

◆ DATA_SYS_PRTYPE_MASK

#define DATA_SYS_PRTYPE_MASK   0xF /* mask to extract the above from prtype */

◆ DATA_UNSIGNED

#define DATA_UNSIGNED
Value:
512 /* this id ORed to the precise type when \
we have an unsigned integer type */

◆ DATA_VAR_POINT

#define DATA_VAR_POINT
Value:
16 /* geometry datatype of variable length \
POINT, used when we want to store POINT \
as BLOB internally */

◆ DATA_VARCHAR

#define DATA_VARCHAR
Value:
1 /* character varying of the \
latin1_swedish_ci charset-collation; note \
that the MySQL format for this, DATA_BINARY, \
DATA_VARMYSQL, is also affected by whether the \
'precise type' contains \
DATA_MYSQL_TRUE_VARCHAR */

◆ DATA_VARMYSQL

#define DATA_VARMYSQL   12 /* any charset varying length char */

◆ DATA_VIRTUAL

#define DATA_VIRTUAL   8192 /* Virtual column */

◆ MAX_CHAR_COLL_NUM

#define MAX_CHAR_COLL_NUM   32767

Enumeration Type Documentation

◆ ib_like_t

enum ib_like_t

SQL Like operator comparison types.

Enumerator
IB_LIKE_EXACT 

e.g.

STRING

IB_LIKE_PREFIX 

e.g., STRING%

Function Documentation

◆ dtype_copy()

UNIV_INLINE void dtype_copy ( dtype_t type1,
const dtype_t type2 
)

Copies a data type structure.

Parameters
[in]type1type struct to copy to
[in]type2type struct to copy from

◆ dtype_form_prtype()

ulint dtype_form_prtype ( ulint  old_prtype,
ulint  charset_coll 
)

Forms a precise type from the < 4.1.2 format precise type plus the charset-collation code.

Returns
precise type, including the charset-collation code in: MySQL charset-collation code
precise type, including the charset-collation code

◆ dtype_get_at_most_n_mbchars()

ulint dtype_get_at_most_n_mbchars ( ulint  prtype,
ulint  mbminmaxlen,
ulint  prefix_len,
ulint  data_len,
const char *  str 
)

Determine how many bytes the first n characters of the given string occupy.

If the string is shorter than n characters, returns the number of bytes the characters in the string occupy.

Returns
length of the prefix, in bytes in: the string whose prefix length is being determined

If the string is shorter than n characters, returns the number of bytes the characters in the string occupy.

Returns
length of the prefix, in bytes

◆ dtype_get_charset_coll()

UNIV_INLINE ulint dtype_get_charset_coll ( ulint  prtype)

Gets the MySQL charset-collation code for MySQL string types.

Returns
MySQL charset-collation code in: precise data type

◆ dtype_get_fixed_size_low()

UNIV_INLINE ulint dtype_get_fixed_size_low ( ulint  mtype,
ulint  prtype,
ulint  len,
ulint  mbminmaxlen,
ulint  comp 
)

Returns the size of a fixed size data type, 0 if not a fixed size type.

Parameters
[in]mtypemain type
[in]prtypeprecise type
[in]lenlength
[in]mbminmaxlenminimum and maximum length of a multibyte character, in bytes
[in]compnonzero=ROW_FORMAT=COMPACT
Returns
fixed size, or 0

◆ dtype_get_len()

UNIV_INLINE ulint dtype_get_len ( const dtype_t type)

Gets the type length.

Returns
fixed length of the type, in bytes, or 0 if variable-length in: data type

◆ dtype_get_max_size_low()

UNIV_INLINE ulint dtype_get_max_size_low ( ulint  mtype,
ulint  len 
)

Returns the maximum size of a data type.

Note: types in system tables may be incomplete and return incorrect information.

Parameters
[in]mtypemain type
[in]lenlength
Returns
maximum size

◆ dtype_get_mblen()

UNIV_INLINE void dtype_get_mblen ( ulint  mtype,
ulint  prtype,
ulint *  mbminlen,
ulint *  mbmaxlen 
)

Compute the mbminlen and mbmaxlen members of a data type structure.

Parameters
[in]mtypemain type
[in]prtypeprecise type (and collation)
[out]mbminlenminimum length of a multi-byte character
[out]mbmaxlenmaximum length of a multi-byte character

◆ dtype_get_mbmaxlen()

UNIV_INLINE ulint dtype_get_mbmaxlen ( const dtype_t type)

Gets the maximum length of a character, in bytes.

Returns
maximum length of a char, in bytes, or 0 if this is not a character type in: type

◆ dtype_get_mbminlen()

UNIV_INLINE ulint dtype_get_mbminlen ( const dtype_t type)

Gets the minimum length of a character, in bytes.

Returns
minimum length of a char, in bytes, or 0 if this is not a character type in: type

◆ dtype_get_min_size_low()

UNIV_INLINE ulint dtype_get_min_size_low ( ulint  mtype,
ulint  prtype,
ulint  len,
ulint  mbminmaxlen 
)

Returns the minimum size of a data type.

Parameters
[in]mtypemain type
[in]prtypeprecise type
[in]lenlength
[in]mbminmaxlenminimum and maximum length of a multibyte character, in bytes
Returns
minimum size

◆ dtype_get_mtype()

UNIV_INLINE ulint dtype_get_mtype ( const dtype_t type)

Gets the SQL main data type.

Returns
SQL main data type in: data type

◆ dtype_get_mysql_type()

UNIV_INLINE ulint dtype_get_mysql_type ( const dtype_t type)

Gets the MySQL type code from a dtype.

Returns
MySQL type code; this is NOT an InnoDB type code! in: type struct

◆ dtype_get_prtype()

UNIV_INLINE ulint dtype_get_prtype ( const dtype_t type)

Gets the precise data type.

Returns
precise data type in: data type

◆ dtype_get_sql_null_size()

UNIV_INLINE ulint dtype_get_sql_null_size ( const dtype_t type,
ulint  comp 
)

Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a type.

For fixed length types it is the fixed length of the type, otherwise 0.

Parameters
[in]typetype struct
[in]compnonzero=ROW_FORMAT=COMPACT
Returns
SQL null storage size in ROW_FORMAT=REDUNDANT

◆ dtype_is_binary_string_type()

ibool dtype_is_binary_string_type ( ulint  mtype,
ulint  prtype 
)

Checks if a type is a binary string type.

Note that for tables created with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For those DATA_BLOB columns this function currently returns FALSE.

Returns
true if binary string type in: precise type

Note that for tables created with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For those DATA_BLOB columns this function currently returns FALSE.

Returns
true if binary string type

◆ dtype_is_non_binary_string_type()

ibool dtype_is_non_binary_string_type ( ulint  mtype,
ulint  prtype 
)

Checks if a type is a non-binary string type.

That is, dtype_is_string_type is TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For those DATA_BLOB columns this function currently returns TRUE.

Returns
true if non-binary string type in: precise type

That is, dtype_is_string_type is TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For those DATA_BLOB columns this function currently returns TRUE.

Returns
true if non-binary string type

◆ dtype_is_string_type()

ibool dtype_is_string_type ( ulint  mtype)

Checks if a data main type is a string type.

Also a BLOB is considered a string type.

Returns
true if string type in: InnoDB main data type code: DATA_CHAR, ...

Also a BLOB is considered a string type.

Returns
true if string type

◆ dtype_is_utf8()

UNIV_INLINE ibool dtype_is_utf8 ( ulint  prtype)

Determines if a MySQL string type is a subset of UTF-8.

This function may return false negatives, in case further character-set collation codes are introduced in MySQL later.

Returns
true if a subset of UTF-8 in: precise data type

◆ dtype_new_read_for_order_and_null_size()

UNIV_INLINE void dtype_new_read_for_order_and_null_size ( dtype_t type,
const byte buf 
)

Reads to a type the stored information which determines its alphabetical ordering and the storage size of an SQL NULL value.

This is the 4.1.x storage format.

Parameters
[in]typetype struct
[in]bufbuffer for stored type order info

◆ dtype_new_store_for_order_and_null_size()

UNIV_INLINE void dtype_new_store_for_order_and_null_size ( byte buf,
const dtype_t type,
ulint  prefix_len 
)

Stores for a type the information which determines its alphabetical ordering and the storage size of an SQL NULL value.

This is the >= 4.1.x storage format.

Parameters
[in]bufbuffer for DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE bytes where we store the info
[in]typetype struct
[in]prefix_lenprefix length to replace type->len, or 0

◆ dtype_print()

void dtype_print ( const dtype_t type)

Print a data type structure.

Parameters
[in]typedata type

◆ dtype_read_for_order_and_null_size()

UNIV_INLINE void dtype_read_for_order_and_null_size ( dtype_t type,
const byte buf 
)

Reads to a type the stored information which determines its alphabetical ordering and the storage size of an SQL NULL value.

Parameters
[in]typetype struct
[in]bufbuffer for the stored order info

◆ dtype_set()

UNIV_INLINE void dtype_set ( dtype_t type,
ulint  mtype,
ulint  prtype,
ulint  len 
)

Sets a data type structure.

Parameters
[in]typetype struct to init
[in]mtypemain data type
[in]prtypeprecise type
[in]lenprecision of type

◆ dtype_set_mbminmaxlen()

UNIV_INLINE void dtype_set_mbminmaxlen ( dtype_t type,
ulint  mbminlen,
ulint  mbmaxlen 
)

Sets the minimum and maximum length of a character, in bytes.

Parameters
[in,out]typetype
[in]mbminlenminimum length of a char, in bytes, or 0 if this is not a character type
[in]mbmaxlenmaximum length of a char, in bytes, or 0 if this is not a character type

◆ dtype_sql_name()

UNIV_INLINE char* dtype_sql_name ( unsigned  mtype,
unsigned  prtype,
unsigned  len,
char *  name,
unsigned  name_sz 
)

Returns the type's SQL name (e.g.

BIGINT UNSIGNED) from mtype,prtype,len

Parameters
[in]mtypemain type
[in]prtypeprecise type
[in]lenlength
[out]nameSQL name
[in]name_szsize of the name buffer
Returns
the SQL type name

◆ dtype_validate()

ibool dtype_validate ( const dtype_t type)

Validates a data type structure.

Returns
true if ok in: type struct to validate
true if ok

◆ operator<<()

std::ostream& operator<< ( std::ostream &  out,
const dtype_t obj 
)
inline

Variable Documentation

◆ data_mysql_default_charset_coll

ulint data_mysql_default_charset_coll

◆ DATA_ROLL_PTR

constexpr size_t DATA_ROLL_PTR = 2
constexpr

Rollback data pointer: 7 bytes.

◆ DATA_ROLL_PTR_LEN

constexpr size_t DATA_ROLL_PTR_LEN = 7
constexpr

Rollback data pointer type size in bytes.

◆ DATA_TRX_ID

constexpr size_t DATA_TRX_ID = 1
constexpr

Transaction id: 6 bytes.

◆ DATA_TRX_ID_LEN

constexpr size_t DATA_TRX_ID_LEN = 6
constexpr

Transaction ID type size in bytes.

DATA_BLOB
#define DATA_BLOB
Definition: data0type.h:59
DATA_VAR_POINT
#define DATA_VAR_POINT
Definition: data0type.h:92
DATA_GEOMETRY
#define DATA_GEOMETRY
Definition: data0type.h:86
DATA_BINARY_TYPE
#define DATA_BINARY_TYPE
Definition: data0type.h:185