29
29
#include "rem0types.h"
31
31
/*********************************************************************//**
32
Gets the minimum number of bytes per character.
33
@return minimum multi-byte char size, in bytes */
36
dict_col_get_mbminlen(
37
/*==================*/
38
const dict_col_t* col) /*!< in: column */
40
return(DATA_MBMINLEN(col->mbminmaxlen));
42
/*********************************************************************//**
43
Gets the maximum number of bytes per character.
44
@return maximum multi-byte char size, in bytes */
47
dict_col_get_mbmaxlen(
48
/*==================*/
49
const dict_col_t* col) /*!< in: column */
51
return(DATA_MBMAXLEN(col->mbminmaxlen));
53
/*********************************************************************//**
54
Sets the minimum and maximum number of bytes per character. */
57
dict_col_set_mbminmaxlen(
58
/*=====================*/
59
dict_col_t* col, /*!< in/out: column */
60
ulint mbminlen, /*!< in: minimum multi-byte
61
character size, in bytes */
62
ulint mbmaxlen) /*!< in: minimum multi-byte
63
character size, in bytes */
65
ut_ad(mbminlen < DATA_MBMAX);
66
ut_ad(mbmaxlen < DATA_MBMAX);
67
ut_ad(mbminlen <= mbmaxlen);
69
col->mbminmaxlen = DATA_MBMINMAXLEN(mbminlen, mbmaxlen);
71
/*********************************************************************//**
32
72
Gets the column data type. */
42
82
type->mtype = col->mtype;
43
83
type->prtype = col->prtype;
44
84
type->len = col->len;
45
type->mbminlen = col->mbminlen;
46
type->mbmaxlen = col->mbmaxlen;
85
type->mbminmaxlen = col->mbminmaxlen;
48
87
#endif /* !UNIV_HOTBACKUP */
65
104
ut_ad(col->prtype == type->prtype);
66
105
ut_ad(col->len == type->len);
67
106
# ifndef UNIV_HOTBACKUP
68
ut_ad(col->mbminlen == type->mbminlen);
69
ut_ad(col->mbmaxlen == type->mbmaxlen);
107
ut_ad(col->mbminmaxlen == type->mbminmaxlen);
70
108
# endif /* !UNIV_HOTBACKUP */
84
122
const dict_col_t* col) /*!< in: column */
86
124
return(dtype_get_min_size_low(col->mtype, col->prtype, col->len,
87
col->mbminlen, col->mbmaxlen));
89
127
/***********************************************************************//**
90
128
Returns the maximum size of the column.
109
147
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
111
149
return(dtype_get_fixed_size_low(col->mtype, col->prtype, col->len,
112
col->mbminlen, col->mbmaxlen, comp));
150
col->mbminmaxlen, comp));
114
152
/***********************************************************************//**
115
153
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
789
827
ut_ad(mutex_own(&(dict_sys->mutex)));
791
829
/* Look for the table name in the hash table */
792
fold = ut_fold_dulint(table_id);
830
fold = ut_fold_ull(table_id);
794
832
HASH_SEARCH(id_hash, dict_sys->table_id_hash, fold,
795
833
dict_table_t*, table, ut_ad(table->cached),
796
!ut_dulint_cmp(table->id, table_id));
834
table->id == table_id);
797
835
if (table == NULL) {
798
836
table = dict_load_table_on_id(table_id);