37 #ifndef UNIV_HOTBACKUP
56 #define DICT_CLUSTERED 1
58 #define DICT_UNIVERSAL 4
61 #define DICT_CORRUPT 16
66 #define DICT_IT_BITS 6
72 #define DICT_TABLE_ORDINARY 1
73 #define DICT_TABLE_CLUSTER_MEMBER 2
74 #define DICT_TABLE_CLUSTER 3
99 #define DICT_TF_REDUNDANT 0
101 #define DICT_TF_COMPACT 1
105 #define DICT_N_COLS_COMPACT 0x80000000UL
108 #define DICT_TF_WIDTH_COMPACT 1
110 #define DICT_TF_WIDTH_ZIP_SSIZE 4
116 #define DICT_TF_WIDTH_ATOMIC_BLOBS 1
121 #define DICT_TF_WIDTH_DATA_DIR 1
124 #define DICT_TF_BITS (DICT_TF_WIDTH_COMPACT \
125 + DICT_TF_WIDTH_ZIP_SSIZE \
126 + DICT_TF_WIDTH_ATOMIC_BLOBS \
127 + DICT_TF_WIDTH_DATA_DIR)
130 #define DICT_TF_BIT_MASK (~(~0 << DICT_TF_BITS))
133 #define DICT_TF_POS_COMPACT 0
135 #define DICT_TF_POS_ZIP_SSIZE (DICT_TF_POS_COMPACT \
136 + DICT_TF_WIDTH_COMPACT)
138 #define DICT_TF_POS_ATOMIC_BLOBS (DICT_TF_POS_ZIP_SSIZE \
139 + DICT_TF_WIDTH_ZIP_SSIZE)
141 #define DICT_TF_POS_DATA_DIR (DICT_TF_POS_ATOMIC_BLOBS \
142 + DICT_TF_WIDTH_ATOMIC_BLOBS)
144 #define DICT_TF_POS_UNUSED (DICT_TF_POS_DATA_DIR \
145 + DICT_TF_WIDTH_DATA_DIR)
148 #define DICT_TF_MASK_COMPACT \
149 ((~(~0 << DICT_TF_WIDTH_COMPACT)) \
150 << DICT_TF_POS_COMPACT)
152 #define DICT_TF_MASK_ZIP_SSIZE \
153 ((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \
154 << DICT_TF_POS_ZIP_SSIZE)
156 #define DICT_TF_MASK_ATOMIC_BLOBS \
157 ((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
158 << DICT_TF_POS_ATOMIC_BLOBS)
160 #define DICT_TF_MASK_DATA_DIR \
161 ((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \
162 << DICT_TF_POS_DATA_DIR)
165 #define DICT_TF_GET_COMPACT(flags) \
166 ((flags & DICT_TF_MASK_COMPACT) \
167 >> DICT_TF_POS_COMPACT)
169 #define DICT_TF_GET_ZIP_SSIZE(flags) \
170 ((flags & DICT_TF_MASK_ZIP_SSIZE) \
171 >> DICT_TF_POS_ZIP_SSIZE)
173 #define DICT_TF_HAS_ATOMIC_BLOBS(flags) \
174 ((flags & DICT_TF_MASK_ATOMIC_BLOBS) \
175 >> DICT_TF_POS_ATOMIC_BLOBS)
177 #define DICT_TF_HAS_DATA_DIR(flags) \
178 ((flags & DICT_TF_MASK_DATA_DIR) \
179 >> DICT_TF_POS_DATA_DIR)
181 #define DICT_TF_GET_UNUSED(flags) \
182 (flags >> DICT_TF_POS_UNUSED)
194 #define DICT_TF2_BITS 6
195 #define DICT_TF2_BIT_MASK ~(~0 << DICT_TF2_BITS)
198 #define DICT_TF2_TEMPORARY 1
200 #define DICT_TF2_FTS_HAS_DOC_ID 2
202 #define DICT_TF2_FTS 4
205 #define DICT_TF2_FTS_ADD_DOC_ID 8
208 #define DICT_TF2_USE_TABLESPACE 16
211 #define DICT_TF2_DISCARDED 32
214 #define DICT_TF2_FLAG_SET(table, flag) \
215 (table->flags2 |= (flag))
217 #define DICT_TF2_FLAG_IS_SET(table, flag) \
218 (table->flags2 & (flag))
220 #define DICT_TF2_FLAG_UNSET(table, flag) \
221 (table->flags2 &= ~(flag))
229 #define DICT_FK_MAX_RECURSIVE_LOAD 20
237 #define FK_MAX_CASCADE_DEL 255
271 __attribute__((nonnull(1)));
282 __attribute__((nonnull));
306 const char* index_name,
321 const char* index_name,
383 UNIV_INTERN __attribute__((nonnull, warn_unused_result))
385 dict_mem_create_temporary_tablename(
417 unsigned mbminmaxlen:5;
431 unsigned max_prefix:12;
447 #define DICT_ANTELOPE_MAX_INDEX_COL_LEN REC_ANTELOPE_MAX_INDEX_COL_LEN
454 #define DICT_MAX_FIELD_LEN_BY_FORMAT(table) \
455 ((dict_table_get_format(table) < UNIV_FORMAT_B) \
456 ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
457 : REC_VERSION_56_MAX_INDEX_COL_LEN)
459 #define DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags) \
460 ((DICT_TF_HAS_ATOMIC_BLOBS(flags) < UNIV_FORMAT_B) \
461 ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
462 : REC_VERSION_56_MAX_INDEX_COL_LEN)
465 #define DICT_MAX_FIXED_COL_LEN DICT_ANTELOPE_MAX_INDEX_COL_LEN
506 #define ZIP_PAD_ROUND_LEN (128)
509 #define ZIP_PAD_SUCCESSFUL_ROUND_LIMIT (5)
512 #define ZIP_PAD_INCR (128)
544 #ifndef UNIV_HOTBACKUP
552 #define MAX_KEY_LENGTH_BITS 12
558 #if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
559 # error (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
584 #ifndef UNIV_HOTBACKUP
610 ib_uint64_t* stat_n_non_null_key_vals;
632 #ifdef UNIV_BLOB_DEBUG
642 # define DICT_INDEX_MAGIC_N 76789786
712 #define DICT_FOREIGN_ON_DELETE_CASCADE 1
713 #define DICT_FOREIGN_ON_DELETE_SET_NULL 2
714 #define DICT_FOREIGN_ON_UPDATE_CASCADE 4
715 #define DICT_FOREIGN_ON_UPDATE_SET_NULL 8
716 #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16
717 #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32
726 const char* dir_path_of_temp_table;
739 unsigned ibd_file_missing:1;
746 unsigned to_be_dropped:1;
756 unsigned can_be_evicted:1;
759 unsigned corrupted:1;
761 unsigned drop_aborted:1;
766 const char* col_names;
772 #ifndef UNIV_HOTBACKUP
773 hash_node_t name_hash;
786 unsigned fk_max_recusive_level:8;
792 ulint n_foreign_key_checks_running;
814 ibool does_not_fit_in_memory;
833 unsigned stat_initialized:1;
838 ib_uint32_t stat_persistent;
855 #define DICT_STATS_PERSISTENT_ON (1 << 1)
856 #define DICT_STATS_PERSISTENT_OFF (1 << 2)
857 ib_uint32_t stats_auto_recalc;
876 #define DICT_STATS_AUTO_RECALC_ON (1 << 1)
877 #define DICT_STATS_AUTO_RECALC_OFF (1 << 2)
878 ulint stats_sample_pages;
884 ib_uint64_t stat_n_rows;
887 ulint stat_clustered_index_size;
892 ib_uint64_t stat_modified_counter;
905 #define BG_STAT_NONE 0
906 #define BG_STAT_IN_PROGRESS (1 << 0)
912 #define BG_STAT_SHOULD_QUIT (1 << 1)
952 ulong n_waiting_or_granted_auto_inc_locks;
995 # define DICT_TABLE_MAGIC_N 76333786
1000 #include "dict0mem.ic"