MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
data0type.cc File Reference
#include "data0type.h"
#include "ha_prototypes.h"
Include dependency graph for data0type.cc:

Go to the source code of this file.

Functions

UNIV_INTERN ulint dtype_get_at_most_n_mbchars (ulint prtype, ulint mbminmaxlen, ulint prefix_len, ulint data_len, const char *str)
UNIV_INTERN ibool dtype_is_string_type (ulint mtype)
UNIV_INTERN ibool dtype_is_binary_string_type (ulint mtype, ulint prtype)
UNIV_INTERN ibool dtype_is_non_binary_string_type (ulint mtype, ulint prtype)
UNIV_INTERN ulint dtype_form_prtype (ulint old_prtype, ulint charset_coll)
UNIV_INTERN ibool dtype_validate (const dtype_t *type)
UNIV_INTERN void dtype_print (const dtype_t *type)

Variables

UNIV_INTERN ulint data_mysql_default_charset_coll

Detailed Description

Data types

Created 1/16/1996 Heikki Tuuri

Definition in file data0type.cc.

Function Documentation

UNIV_INTERN 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
Parameters
old_prtypein: the MySQL type code and the flags DATA_BINARY_TYPE etc.
charset_collin: MySQL charset-collation code

Definition at line 154 of file data0type.cc.

Here is the caller graph for this function:

UNIV_INTERN 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
Parameters
prtypein: precise type
mbminmaxlenin: minimum and maximum length of a multi-byte character
prefix_lenin: length of the requested prefix, in characters, multiplied by dtype_get_mbmaxlen(dtype)
data_lenin: length of str (in bytes)
strin: the string whose prefix length is being determined

Definition at line 49 of file data0type.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN 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
Parameters
mtypein: main data type
prtypein: precise type

Definition at line 111 of file data0type.cc.

Here is the caller graph for this function:

UNIV_INTERN 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
Parameters
mtypein: main data type
prtypein: precise type

Definition at line 134 of file data0type.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN 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
Parameters
mtypein: InnoDB main data type code: DATA_CHAR, ...

Definition at line 90 of file data0type.cc.

Here is the caller graph for this function:

UNIV_INTERN void dtype_print ( const dtype_t type)

Prints a data type structure.

Parameters
typein: type

Definition at line 195 of file data0type.cc.

UNIV_INTERN ibool dtype_validate ( const dtype_t type)

Validates a data type structure.

Returns
TRUE if ok
Parameters
typein: type struct to validate

Definition at line 171 of file data0type.cc.

Here is the call graph for this function: