📄 data0type.h
字号:
ulint prtype);/* in: precise type *//*************************************************************************Sets a data type structure. */UNIV_INLINEvoiddtype_set(/*======*/ dtype_t* type, /* in: type struct to init */ ulint mtype, /* in: main data type */ ulint prtype, /* in: precise type */ ulint len, /* in: length of type */ ulint prec); /* in: precision of type *//*************************************************************************Copies a data type structure. */UNIV_INLINEvoiddtype_copy(/*=======*/ dtype_t* type1, /* in: type struct to copy to */ dtype_t* type2); /* in: type struct to copy from *//*************************************************************************Gets the SQL main data type. */UNIV_INLINEulintdtype_get_mtype(/*============*/ dtype_t* type);/*************************************************************************Gets the precise data type. */UNIV_INLINEulintdtype_get_prtype(/*=============*/ dtype_t* type);/*************************************************************************Gets the MySQL charset-collation code for MySQL string types. */ulintdtype_get_charset_coll_noninline(/*=============================*/ ulint prtype);/* in: precise data type *//*************************************************************************Gets the MySQL charset-collation code for MySQL string types. */UNIV_INLINEulintdtype_get_charset_coll(/*===================*/ ulint prtype);/* in: precise data type *//*************************************************************************Forms a precise type from the < 4.1.2 format precise type plus thecharset-collation code. */ulintdtype_form_prtype(/*==============*/ ulint old_prtype, /* in: the MySQL type code and the flags DATA_BINARY_TYPE etc. */ ulint charset_coll); /* in: MySQL charset-collation code *//*************************************************************************Gets the type length. */UNIV_INLINEulintdtype_get_len(/*==========*/ dtype_t* type);/*************************************************************************Gets the type precision. */UNIV_INLINEulintdtype_get_prec(/*===========*/ dtype_t* type);/*************************************************************************Gets the minimum length of a character, in bytes. */UNIV_INLINEulintdtype_get_mbminlen(/*===============*/ /* out: minimum length of a char, in bytes, or 0 if this is not a character type */ const dtype_t* type); /* in: type *//*************************************************************************Gets the maximum length of a character, in bytes. */UNIV_INLINEulintdtype_get_mbmaxlen(/*===============*/ /* out: maximum length of a char, in bytes, or 0 if this is not a character type */ const dtype_t* type); /* in: type *//*************************************************************************Gets the padding character code for the type. */UNIV_INLINEulintdtype_get_pad_char(/*===============*/ /* out: padding character code, or ULINT_UNDEFINED if no padding specified */ const dtype_t* type); /* in: type *//***************************************************************************Returns the size of a fixed size data type, 0 if not a fixed size type. */UNIV_INLINEulintdtype_get_fixed_size(/*=================*/ /* out: fixed size, or 0 */ dtype_t* type); /* in: type *//***************************************************************************Returns the minimum size of a data type. */UNIV_INLINEulintdtype_get_min_size(/*===============*/ /* out: minimum size */ const dtype_t* type); /* in: type *//***************************************************************************Returns a stored SQL NULL size for a type. For fixed length types it isthe fixed length of the type, otherwise 0. */UNIV_INLINEulintdtype_get_sql_null_size(/*====================*/ /* out: SQL null storage size */ dtype_t* type); /* in: type *//***************************************************************************Returns TRUE if a type is of a fixed size. */UNIV_INLINEibooldtype_is_fixed_size(/*================*/ /* out: TRUE if fixed size */ dtype_t* type); /* in: type *//**************************************************************************Reads to a type the stored information which determines its alphabeticalordering and the storage size of an SQL NULL value. */UNIV_INLINEvoiddtype_read_for_order_and_null_size(/*===============================*/ dtype_t* type, /* in: type struct */ byte* buf); /* in: buffer for the stored order info *//**************************************************************************Stores for a type the information which determines its alphabetical orderingand the storage size of an SQL NULL value. This is the >= 4.1.x storageformat. */UNIV_INLINEvoiddtype_new_store_for_order_and_null_size(/*====================================*/ byte* buf, /* in: buffer for DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE bytes where we store the info */ dtype_t* type); /* in: type struct *//**************************************************************************Reads to a type the stored information which determines its alphabeticalordering and the storage size of an SQL NULL value. This is the 4.1.x storageformat. */UNIV_INLINEvoiddtype_new_read_for_order_and_null_size(/*===================================*/ dtype_t* type, /* in: type struct */ byte* buf); /* in: buffer for stored type order info *//*************************************************************************Validates a data type structure. */ibooldtype_validate(/*===========*/ /* out: TRUE if ok */ dtype_t* type); /* in: type struct to validate *//*************************************************************************Prints a data type structure. */voiddtype_print(/*========*/ dtype_t* type); /* in: type *//* Structure for an SQL data type.If you add fields to this structure, be sure to initialize them everywhere.This structure is initialized in the following functions:dtype_set()dtype_read_for_order_and_null_size()dtype_new_read_for_order_and_null_size()sym_tab_add_null_lit() */struct dtype_struct{ ulint mtype; /* main data type */ ulint prtype; /* precise type; MySQL data type, charset code, flags to indicate nullability, signedness, whether this is a binary string, whether this is a true VARCHAR where MySQL uses 2 bytes to store the length */ /* the remaining fields do not affect alphabetical ordering: */ ulint len; /* length; for MySQL data this is field->pack_length(), except that for a >= 5.0.3 type true VARCHAR this is the maximum byte length of the string data (in addition to the string, MySQL uses 1 or 2 bytes to store the string length) */ ulint prec; /* precision */ ulint mbminlen; /* minimum length of a character, in bytes */ ulint mbmaxlen; /* maximum length of a character, in bytes */};#ifndef UNIV_NONINL#include "data0type.ic"#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -