MySQL 8.4.2
Source Code Documentation
|
Data types. More...
Functions | |
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... | |
bool | dtype_is_string_type (ulint mtype) |
Checks if a data main type is a string type. More... | |
bool | dtype_is_binary_string_type (ulint mtype, ulint prtype) |
Checks if a type is a binary string type. More... | |
bool | dtype_is_non_binary_string_type (ulint mtype, ulint prtype) |
Checks if a type is a non-binary string type. 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... | |
bool | 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... | |
Variables | |
ulint | data_mysql_default_charset_coll |
Data types.
Created 1/16/1996 Heikki Tuuri
Forms a precise type from the < 4.1.2 format precise type plus the charset-collation code.
old_prtype | in: the MySQL type code and the flags DATA_BINARY_TYPE etc. |
charset_coll | in: MySQL charset-collation code |
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.
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 |
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.
mtype | in: main data type |
prtype | in: precise type |
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.
mtype | in: main data type |
prtype | in: precise type |
bool dtype_is_string_type | ( | ulint | mtype | ) |
Checks if a data main type is a string type.
Also a BLOB is considered a string type.
mtype | in: InnoDB main data type code: DATA_CHAR, ... |
void dtype_print | ( | const dtype_t * | type | ) |
Print a data type structure.
[in] | type | data type |
bool dtype_validate | ( | const dtype_t * | type | ) |
Validates a data type structure.
type | in: type struct to validate |
ulint data_mysql_default_charset_coll |