Go to the source code of this file.
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_prtype | in: the MySQL type code and the flags DATA_BINARY_TYPE etc. |
charset_coll | in: MySQL charset-collation code |
Definition at line 154 of file data0type.cc.
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
-
prtype | in: precise type |
mbminmaxlen | in: minimum and maximum length of a multi-byte character |
prefix_len | in: length of the requested prefix, in characters, multiplied by dtype_get_mbmaxlen(dtype) |
data_len | in: length of str (in bytes) |
str | in: the string whose prefix length is being determined |
Definition at line 49 of file data0type.cc.
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
-
mtype | in: main data type |
prtype | in: precise type |
Definition at line 111 of file data0type.cc.
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
-
mtype | in: main data type |
prtype | in: precise type |
Definition at line 134 of file data0type.cc.
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
-
mtype | in: InnoDB main data type code: DATA_CHAR, ... |
Definition at line 90 of file data0type.cc.
UNIV_INTERN void dtype_print |
( |
const dtype_t * |
type | ) |
|
Prints a data type structure.
- Parameters
-
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
-
type | in: type struct to validate |
Definition at line 171 of file data0type.cc.