37 #ifndef UNIV_HOTBACKUP
60 #define DICT_CLUSTERED 1
62 #define DICT_UNIVERSAL 4
65 #define DICT_CORRUPT 16
70 #define DICT_IT_BITS 6
76 #define DICT_TABLE_ORDINARY 1
77 #define DICT_TABLE_CLUSTER_MEMBER 2
78 #define DICT_TABLE_CLUSTER 3
103 #define DICT_TF_REDUNDANT 0
105 #define DICT_TF_COMPACT 1
109 #define DICT_N_COLS_COMPACT 0x80000000UL
112 #define DICT_TF_WIDTH_COMPACT 1
114 #define DICT_TF_WIDTH_ZIP_SSIZE 4
120 #define DICT_TF_WIDTH_ATOMIC_BLOBS 1
125 #define DICT_TF_WIDTH_DATA_DIR 1
128 #define DICT_TF_BITS (DICT_TF_WIDTH_COMPACT \
129 + DICT_TF_WIDTH_ZIP_SSIZE \
130 + DICT_TF_WIDTH_ATOMIC_BLOBS \
131 + DICT_TF_WIDTH_DATA_DIR)
134 #define DICT_TF_BIT_MASK (~(~0 << DICT_TF_BITS))
137 #define DICT_TF_POS_COMPACT 0
139 #define DICT_TF_POS_ZIP_SSIZE (DICT_TF_POS_COMPACT \
140 + DICT_TF_WIDTH_COMPACT)
142 #define DICT_TF_POS_ATOMIC_BLOBS (DICT_TF_POS_ZIP_SSIZE \
143 + DICT_TF_WIDTH_ZIP_SSIZE)
145 #define DICT_TF_POS_DATA_DIR (DICT_TF_POS_ATOMIC_BLOBS \
146 + DICT_TF_WIDTH_ATOMIC_BLOBS)
148 #define DICT_TF_POS_UNUSED (DICT_TF_POS_DATA_DIR \
149 + DICT_TF_WIDTH_DATA_DIR)
152 #define DICT_TF_MASK_COMPACT \
153 ((~(~0 << DICT_TF_WIDTH_COMPACT)) \
154 << DICT_TF_POS_COMPACT)
156 #define DICT_TF_MASK_ZIP_SSIZE \
157 ((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \
158 << DICT_TF_POS_ZIP_SSIZE)
160 #define DICT_TF_MASK_ATOMIC_BLOBS \
161 ((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
162 << DICT_TF_POS_ATOMIC_BLOBS)
164 #define DICT_TF_MASK_DATA_DIR \
165 ((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \
166 << DICT_TF_POS_DATA_DIR)
169 #define DICT_TF_GET_COMPACT(flags) \
170 ((flags & DICT_TF_MASK_COMPACT) \
171 >> DICT_TF_POS_COMPACT)
173 #define DICT_TF_GET_ZIP_SSIZE(flags) \
174 ((flags & DICT_TF_MASK_ZIP_SSIZE) \
175 >> DICT_TF_POS_ZIP_SSIZE)
177 #define DICT_TF_HAS_ATOMIC_BLOBS(flags) \
178 ((flags & DICT_TF_MASK_ATOMIC_BLOBS) \
179 >> DICT_TF_POS_ATOMIC_BLOBS)
181 #define DICT_TF_HAS_DATA_DIR(flags) \
182 ((flags & DICT_TF_MASK_DATA_DIR) \
183 >> DICT_TF_POS_DATA_DIR)
185 #define DICT_TF_GET_UNUSED(flags) \
186 (flags >> DICT_TF_POS_UNUSED)
198 #define DICT_TF2_BITS 7
199 #define DICT_TF2_BIT_MASK ~(~0 << DICT_TF2_BITS)
202 #define DICT_TF2_TEMPORARY 1
204 #define DICT_TF2_FTS_HAS_DOC_ID 2
206 #define DICT_TF2_FTS 4
209 #define DICT_TF2_FTS_ADD_DOC_ID 8
212 #define DICT_TF2_USE_TABLESPACE 16
215 #define DICT_TF2_DISCARDED 32
219 #define DICT_TF2_FTS_AUX_HEX_NAME 64
222 #define DICT_TF2_FLAG_SET(table, flag) \
223 (table->flags2 |= (flag))
225 #define DICT_TF2_FLAG_IS_SET(table, flag) \
226 (table->flags2 & (flag))
228 #define DICT_TF2_FLAG_UNSET(table, flag) \
229 (table->flags2 &= ~(flag))
237 #define DICT_FK_MAX_RECURSIVE_LOAD 20
245 #define FK_MAX_CASCADE_DEL 255
279 __attribute__((nonnull(1)));
290 __attribute__((nonnull));
313 const char* table_name,
314 const char* index_name,
328 const char* table_name,
329 const char* index_name,
468 #define DICT_ANTELOPE_MAX_INDEX_COL_LEN REC_ANTELOPE_MAX_INDEX_COL_LEN
475 #define DICT_MAX_FIELD_LEN_BY_FORMAT(table) \
476 ((dict_table_get_format(table) < UNIV_FORMAT_B) \
477 ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
478 : REC_VERSION_56_MAX_INDEX_COL_LEN)
480 #define DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags) \
481 ((DICT_TF_HAS_ATOMIC_BLOBS(flags) < UNIV_FORMAT_B) \
482 ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
483 : REC_VERSION_56_MAX_INDEX_COL_LEN)
486 #define DICT_MAX_FIXED_COL_LEN DICT_ANTELOPE_MAX_INDEX_COL_LEN
527 #define ZIP_PAD_ROUND_LEN (128)
530 #define ZIP_PAD_SUCCESSFUL_ROUND_LIMIT (5)
533 #define ZIP_PAD_INCR (128)
569 #ifndef UNIV_HOTBACKUP
577 #define MAX_KEY_LENGTH_BITS 12
583 #if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
584 # error (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
609 #ifndef UNIV_HOTBACKUP
635 ib_uint64_t* stat_n_non_null_key_vals;
657 #ifdef UNIV_BLOB_DEBUG
667 # define DICT_INDEX_MAGIC_N 76789786
800 if (
const char* pos = strchr(foreign->
id,
'/')) {
811 typedef std::set<dict_foreign_t*, dict_foreign_compare> dict_foreign_set;
814 operator<< (std::ostream& out,
const dict_foreign_set& fk_set);
826 return(m_foreigns.find(foreign) == m_foreigns.end());
829 const dict_foreign_set& m_foreigns;
837 const dict_foreign_set& fk_set);
865 : m_foreign_set(foreign_set)
870 std::for_each(m_foreign_set.begin(),
875 const dict_foreign_set& m_foreign_set;
881 #define DICT_FOREIGN_ON_DELETE_CASCADE 1
882 #define DICT_FOREIGN_ON_DELETE_SET_NULL 2
883 #define DICT_FOREIGN_ON_UPDATE_CASCADE 4
884 #define DICT_FOREIGN_ON_UPDATE_SET_NULL 8
885 #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16
886 #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32
892 #define DICT_TABLE_IN_DDL -1
948 #ifndef UNIV_HOTBACKUP
1030 #define DICT_TABLE_IN_USED -1
1057 #define DICT_STATS_PERSISTENT_ON (1 << 1)
1058 #define DICT_STATS_PERSISTENT_OFF (1 << 2)
1078 #define DICT_STATS_AUTO_RECALC_ON (1 << 1)
1079 #define DICT_STATS_AUTO_RECALC_OFF (1 << 2)
1107 #define BG_STAT_NONE 0
1108 #define BG_STAT_IN_PROGRESS (1 << 0)
1114 #define BG_STAT_SHOULD_QUIT (1 << 1)
1202 # define DICT_TABLE_MAGIC_N 76333786
1212 std::pair<dict_foreign_set::iterator, bool> ret
1213 = table->referenced_set.insert(foreign);
1258 #ifdef HAVE_ATOMIC_BUILTINS
1276 #ifdef HAVE_ATOMIC_BUILTINS