52#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY
53#define MI_MAX_KEY HA_MAX_POSSIBLE_KEY
55#define MI_MAX_KEY MAX_INDEXES
58#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
63#define MI_MAX_KEY_LENGTH 1000
64#define MI_MAX_KEY_SEG 16
66#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH + MI_MAX_KEY_SEG * 6 + 8 + 8)
67#define MI_MAX_MSG_BUF 1024
68#define MI_NAME_IEXT ".MYI"
69#define MI_NAME_DEXT ".MYD"
72#define MI_KEY_BLOCK_LENGTH 1024U
73#define MI_MIN_KEY_BLOCK_LENGTH 1024U
74#define MI_MAX_KEY_BLOCK_LENGTH 16384U
83#define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
84#define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
85#define mi_get_mask_all_keys_active(_keys_) \
86 (((_keys_) < MI_KEYMAP_BITS) ? ((1ULL << (_keys_)) - 1ULL) : (~0ULL))
88#if MI_MAX_KEY > MI_KEYMAP_BITS
91 return (((_keyno_) <
MI_KEYMAP_BITS) ? ((_keymap_) & (1ULL << (_keyno_)))
95#define mi_set_key_active(_keymap_, _keyno_) \
96 (_keymap_) |= (((_keyno_) < MI_KEYMAP_BITS) ? (1ULL << (_keyno_)) \
97 : MI_KEYMAP_HIGH_MASK)
98#define mi_clear_key_active(_keymap_, _keyno_) \
99 (_keymap_) &= (((_keyno_) < MI_KEYMAP_BITS) ? (~(1ULL << (_keyno_))) \
105 return ((_keymap_) & (1ULL << (_keyno_)));
107#define mi_set_key_active(_keymap_, _keyno_) (_keymap_) |= (1ULL << (_keyno_))
108#define mi_clear_key_active(_keymap_, _keyno_) \
109 (_keymap_) &= (~(1ULL << (_keyno_)))
114#define mi_is_all_keys_active(_keymap_, _keys_) \
115 ((_keymap_) == mi_get_mask_all_keys_active(_keys_))
116#define mi_set_all_keys_active(_keymap_, _keys_) \
117 (_keymap_) = mi_get_mask_all_keys_active(_keys_)
118#define mi_clear_all_keys_active(_keymap_) (_keymap_) = 0
119#define mi_intersect_keys_active(_to_, _from_) (_to_) &= (_from_)
120#define mi_is_any_intersect_keys_active(_keymap1_, _keys_, _keymap2_) \
121 ((_keymap1_) & (_keymap2_)&mi_get_mask_all_keys_active(_keys_))
122#define mi_copy_keys_active(_to_, _maxkeys_, _from_) \
123 (_to_) = (mi_get_mask_all_keys_active(_maxkeys_) & (_from_))
191 uint key_len, uint comp_flag,
uchar **ret_pos,
uchar *buff,
202#define MI_UNIQUE_HASH_LENGTH 4
258#define mi_close(file) mi_close_share(file, NULL)
261 int mode, uint wait_if_locked);
262#define mi_open(name, mode, wait_if_locked) \
263 mi_open_share(name, NULL, mode, wait_if_locked)
288extern int mi_rename(
const char *from,
const char *to);
294extern int mi_log(
int activate_log);
300#define MEMMAP_EXTRA_MARGIN 7
303#define MYISAMCHK_REPAIR 1
304#define MYISAMCHK_VERIFY 2
312#define TT_FOR_UPGRADE 2
414 int rep_quick,
bool no_copy_stat);
416 const char *new_ext,
myf myflags);
class to copying an field/item to a key struct
Definition: sql_select.h:813
int page
Definition: ctype-mb.cc:1234
#define MY_WAIT_IF_FULL
Definition: my_sys.h:129
#define MY_NABP
Definition: my_sys.h:126
#define MY_WME
Definition: my_sys.h:128
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
static uint keys
Definition: hp_test2.cc:49
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
Key cache variable structures.
#define KEY_CACHE_BLOCK_SIZE
Definition: keycache.h:64
A better implementation of the UNIX ctype(3) library.
This file includes constants used by all storage engines.
#define HA_OFFSET_ERROR
Definition: my_base.h:1144
ha_panic_function
Definition: my_base.h:432
data_file_type
Definition: my_base.h:1070
@ STATIC_RECORD
Definition: my_base.h:1071
ha_rkey_function
Definition: my_base.h:78
ulong key_part_map
Definition: my_base.h:1008
my_off_t ha_rows
Definition: my_base.h:1141
ha_extra_function
Definition: my_base.h:185
en_fieldtype
Definition: my_base.h:1055
Abstraction functions over zlib/intrinsics.
std::uint32_t ha_checksum
Definition: my_checksum.h:106
#define HA_MAX_POSSIBLE_KEY
Definition: my_compare.h:47
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
int16_t int16
Definition: my_inttypes.h:64
uint64_t uint64
Definition: my_inttypes.h:69
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
int File
Definition: my_io_bits.h:51
int mi_scan(MI_INFO *file, uchar *buf)
Definition: mi_scan.cc:48
int movepoint(MI_INFO *info, uchar *record, my_off_t oldpos, my_off_t newpos, uint prot_key)
Definition: mi_check.cc:1702
int filecopy(MI_CHECK *param, File to, File from, my_off_t start, my_off_t length, const char *type)
Definition: mi_check.cc:1967
int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
Definition: mi_check.cc:3316
int mi_write(MI_INFO *file, uchar *buff)
Definition: mi_write.cc:59
int chk_key(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:377
int mi_rlast(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rlast.cc:30
#define MI_KEYMAP_BITS
Definition: myisam.h:83
int test_if_almost_full(MI_INFO *info)
Definition: mi_check.cc:3306
my_off_t mi_position(MI_INFO *file)
Definition: mi_info.cc:39
ulong myisam_block_size
Definition: mi_static.cc:58
const char * myisam_log_filename
Definition: mi_static.cc:55
my_off_t myisam_max_temp_length
Definition: mi_static.cc:63
int(* myisam_test_invalid_symlink)(const char *filename)
Definition: mi_static.cc:73
int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, const char *name, int rep_quick, bool no_copy_stat)
Definition: mi_check.cc:2016
int mi_rnext_same(MI_INFO *info, uchar *buf)
Definition: mi_rnext_same.cc:39
ulonglong myisam_mmap_size
Definition: mi_static.cc:65
#define MI_MAX_POSSIBLE_KEY_BUFF
Definition: myisam.h:58
void lock_memory(MI_CHECK *param)
ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, key_range *max_key)
Definition: mi_range.cc:62
int chk_data_link(MI_CHECK *param, MI_INFO *info, int extend)
Definition: mi_check.cc:889
mysql_mutex_t THR_LOCK_myisam_mmap
Definition: my_thr_init.cc:72
int mi_status(MI_INFO *info, MI_ISAMINFO *x, uint flag)
Definition: mi_info.cc:44
int mi_rrnd(MI_INFO *file, uchar *buf, my_off_t pos)
Definition: mi_rrnd.cc:41
enum_mi_stats_method
Definition: myisam.h:334
@ MI_STATS_METHOD_IGNORE_NULLS
Definition: myisam.h:340
@ MI_STATS_METHOD_NULLS_EQUAL
Definition: myisam.h:338
@ MI_STATS_METHOD_NULLS_NOT_EQUAL
Definition: myisam.h:336
uint mi_get_pointer_length(ulonglong file_length, uint def)
Definition: mi_create.cc:776
ulong myisam_data_pointer_size
Definition: mi_static.cc:64
ulong myisam_concurrent_insert
Definition: mi_static.cc:62
#define MI_MAX_KEY_SEG
Definition: myisam.h:64
int mi_rprev(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rprev.cc:37
int mi_is_changed(MI_INFO *info)
Definition: mi_changed.cc:31
int mi_lock_database(MI_INFO *file, int lock_type)
Definition: mi_locking.cc:46
int mi_close_share(MI_INFO *file, bool *closed_share)
Definition: mi_close.cc:39
int mi_extra(MI_INFO *file, enum ha_extra_function function, void *extra_arg)
Definition: mi_extra.cc:54
int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile)
Definition: mi_check.cc:3468
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, ulonglong *unique, ulonglong *notnull, ulonglong records)
Definition: mi_check.cc:3650
int mi_delete(MI_INFO *file, const uchar *buff)
Definition: mi_delete.cc:51
int mi_log(int activate_log)
Definition: mi_log.cc:50
bool myisam_single_user
Definition: myisam.h:245
MI_INFO * mi_open_share(const char *name, MYISAM_SHARE *old_share, int mode, uint wait_if_locked)
Definition: mi_open.cc:102
st_keycache_thread_var main_thread_keycache_var
Definition: mi_static.cc:67
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, bool repair)
Definition: mi_check.cc:3552
int lock_file(MI_CHECK *param, File file, int lock_type, const char *filetype, const char *filename)
Definition: mi_check.cc:1951
int mi_preload(MI_INFO *info, ulonglong key_map, bool ignore_leaves)
Definition: mi_preload.cc:57
int mi_update(MI_INFO *file, const uchar *old, uchar *new_record)
Definition: mi_update.cc:38
bool mi_is_key_active(uint64 _keymap_, unsigned int _keyno_)
Definition: myisam.h:104
int mi_panic(enum ha_panic_function function)
Definition: mi_panic.cc:37
int chk_status(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:133
int chk_size(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:318
void mi_end_bulk_insert(MI_INFO *info)
Definition: mi_write.cc:925
#define MI_KEYMAP_HIGH_MASK
Definition: myisam.h:84
int mi_rsame(MI_INFO *file, uchar *record, int inx)
Definition: mi_rsame.cc:39
int mi_delete_table(const char *name)
Definition: mi_delete_table.cc:35
bool myisam_flush
Definition: mi_static.cc:59
int mi_rnext(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rnext.cc:38
#define MI_MAX_KEY_BUFF
Definition: myisam.h:66
int update_state_info(MI_CHECK *param, MI_INFO *info, uint update)
Definition: mi_check.cc:3486
int chk_del(MI_CHECK *param, MI_INFO *info, uint test_flag)
Definition: mi_check.cc:158
int mi_reset(MI_INFO *file)
Definition: mi_extra.cc:237
bool mi_is_any_key_active(uint64 _keymap_)
Definition: myisam.h:113
int change_to_newfile(const char *filename, const char *old_ext, const char *new_ext, myf myflags)
Definition: mi_check.cc:1938
int mi_scan_init(MI_INFO *file)
Definition: mi_scan.cc:30
void myisamchk_init(MI_CHECK *param)
Definition: mi_check.cc:112
int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, key_part_map keypart_map, enum ha_rkey_function search_flag)
Definition: mi_rkey.cc:36
int mi_repair(MI_CHECK *param, MI_INFO *info, char *name, int rep_quick, bool no_copy_stat)
Definition: mi_check.cc:1407
ulong _mi_calc_blob_length(uint length, const uchar *pos)
Definition: mi_dynrec.cc:1166
bool myisam_delay_key_write
Definition: myisam.h:245
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
Definition: mi_check.cc:3726
ulonglong myisam_mmap_used
Definition: myisam.h:252
void mi_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache)
Definition: mi_keycache.cc:143
int mi_delete_all_rows(MI_INFO *info)
Definition: mi_delete_all.cc:35
int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map, KEY_CACHE *key_cache)
Definition: mi_keycache.cc:60
int mi_rfirst(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rfirst.cc:30
int mi_rename(const char *from, const char *to)
Definition: mi_rename.cc:34
void mi_flush_bulk_insert(MI_INFO *info, uint inx)
Definition: mi_write.cc:918
int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
Definition: mi_write.cc:866
int mi_rsame_with_pos(MI_INFO *file, uchar *record, int inx, my_off_t pos)
Definition: mi_rsamepos.cc:41
int mi_sort_index(MI_CHECK *param, MI_INFO *info, char *name, bool no_copy_stat)
Definition: mi_check.cc:1750
st_keycache_thread_var * keycache_thread_var()
Definition: ha_myisam.cc:1926
bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, bool force)
Definition: mi_check.cc:3749
int mi_create(const char *name, uint keys, MI_KEYDEF *keydef, uint columns, MI_COLUMNDEF *columndef, uint uniques, MI_UNIQUEDEF *uniquedef, MI_CREATE_INFO *create_info, uint flags)
Definition: mi_create.cc:55
static uint update
Definition: myisamlog.cc:94
static int record
Definition: mysqltest.cc:195
Definition: buf0block_hint.cc:30
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Definition: options.cc:57
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
mode
Definition: file_handle.h:61
const char * filename
Definition: pfs_example_component_population.cc:67
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:29
Definition: my_compare.h:60
Definition: keycache.h:73
Definition: myisamdef.h:244
const char * db_name
Definition: myisam.h:378
my_off_t key_blocks
Definition: myisam.h:351
ulonglong auto_increment_value
Definition: myisam.h:344
my_off_t search_after_block
Definition: myisam.h:349
char temp_filename[FN_REFLEN]
Definition: myisam.h:362
my_off_t start_check_pos
Definition: myisam.h:351
ha_checksum key_crc[HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:375
ha_rows total_deleted
Definition: myisam.h:352
uint out_flag
Definition: myisam.h:356
ulonglong max_record_length
Definition: myisam.h:347
ulonglong use_buffers
Definition: myisam.h:354
const char * table_name
Definition: myisam.h:378
uint error_printed
Definition: myisam.h:356
bool force_sort
Definition: myisam.h:361
uint16 language
Definition: myisam.h:359
bool using_global_keycache
Definition: myisam.h:360
uint opt_sort_key
Definition: myisam.h:357
ulong write_buffer_length
Definition: myisam.h:355
uint max_level
Definition: myisam.h:357
uint testflag
Definition: myisam.h:358
ulong rec_per_key_part[MI_MAX_KEY_SEG *HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:376
bool opt_follow_links
Definition: myisam.h:360
ha_checksum glob_crc
Definition: myisam.h:353
ulonglong unique_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:372
ulonglong keys_in_use
Definition: myisam.h:346
ulong sort_key_blocks
Definition: myisam.h:355
const char * op_name
Definition: myisam.h:379
char * isam_file_name
Definition: myisam.h:362
ulonglong notnull_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:373
ulonglong max_data_file_length
Definition: myisam.h:345
int tmpfile_createflag
Definition: myisam.h:364
uint key_cache_block_size
Definition: myisam.h:358
ha_checksum record_checksum
Definition: myisam.h:353
IO_CACHE read_cache
Definition: myisam.h:366
ha_rows total_records
Definition: myisam.h:352
void * thd
Definition: myisam.h:377
my_off_t totaldata
Definition: myisam.h:351
uint verbose
Definition: myisam.h:356
ulonglong sort_buffer_length
Definition: myisam.h:348
uint total_files
Definition: myisam.h:357
my_off_t new_file_pos
Definition: myisam.h:350
bool retry_repair
Definition: myisam.h:361
uint warning_printed
Definition: myisam.h:356
ulong read_buffer_length
Definition: myisam.h:355
my_off_t key_file_blocks
Definition: myisam.h:350
enum_mi_stats_method stats_method
Definition: myisam.h:380
my_off_t keydata
Definition: myisam.h:351
MY_TMPDIR * tmpdir
Definition: myisam.h:363
myf myf_rw
Definition: myisam.h:365
uint16 null_pos
Definition: myisam.h:233
MI_DECODE_TREE * huff_tree
Definition: myisam.h:239
uint32 offset
Definition: myisam.h:231
void(* unpack)(MI_COLUMNDEF *rec, MI_BIT_BUFF *buff, uchar *start, uchar *end)
Definition: myisam.h:235
int16 type
Definition: myisam.h:229
uint pack_type
Definition: myisam.h:238
enum en_fieldtype base_type
Definition: myisam.h:237
uint space_length_bits
Definition: myisam.h:238
uint16 length
Definition: myisam.h:230
uint8 null_bit
Definition: myisam.h:232
ulonglong data_file_length
Definition: myisam.h:160
uint16 language
Definition: myisam.h:163
ulonglong key_file_length
Definition: myisam.h:161
uint old_options
Definition: myisam.h:162
const char * index_file_name
Definition: myisam.h:156
bool with_auto_increment
Definition: myisam.h:164
ha_rows reloc_rows
Definition: myisam.h:158
const char * data_file_name
Definition: myisam.h:156
ha_rows max_rows
Definition: myisam.h:157
ulonglong auto_increment
Definition: myisam.h:159
uchar * intervalls
Definition: myisam.h:216
uint quick_table_bits
Definition: myisam.h:215
uint16 * table
Definition: myisam.h:214
Definition: myisamdef.h:253
char * data_file_name
Definition: myisam.h:141
uint keys
Definition: myisam.h:142
my_off_t max_index_file_length
Definition: myisam.h:135
time_t create_time
Definition: myisam.h:147
ulonglong key_map
Definition: myisam.h:140
int sortkey
Definition: myisam.h:145
uint reflength
Definition: myisam.h:150
my_off_t newrecpos
Definition: myisam.h:132
my_off_t recpos
Definition: myisam.h:131
ulong reclength
Definition: myisam.h:137
my_off_t max_data_file_length
Definition: myisam.h:135
ulong record_offset
Definition: myisam.h:151
my_off_t data_file_length
Definition: myisam.h:134
ulonglong auto_increment
Definition: myisam.h:139
time_t update_time
Definition: myisam.h:149
ulong mean_reclength
Definition: myisam.h:138
ha_rows deleted
Definition: myisam.h:130
int errkey
Definition: myisam.h:144
ulong * rec_per_key
Definition: myisam.h:152
my_off_t index_file_length
Definition: myisam.h:135
char * index_file_name
Definition: myisam.h:141
ha_rows records
Definition: myisam.h:129
time_t check_time
Definition: myisam.h:148
File filenr
Definition: myisam.h:146
my_off_t delete_length
Definition: myisam.h:136
my_off_t dupp_key_pos
Definition: myisam.h:133
uint16 keysegs
Definition: myisam.h:175
MYISAM_SHARE * share
Definition: myisam.h:174
uint32 version
Definition: myisam.h:185
uint16 block_size_index
Definition: myisam.h:184
HA_KEYSEG * seg
Definition: myisam.h:188
uint16 block_length
Definition: myisam.h:179
uint16 flag
Definition: myisam.h:176
int(* pack_key)(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *next_key, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: myisam.h:194
int(* bin_search)(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, uchar *buff, bool *was_last_key)
Definition: myisam.h:190
struct st_mysql_ftparser * parser
Definition: myisam.h:189
uint16 minlength
Definition: myisam.h:182
HA_KEYSEG * end
Definition: myisam.h:188
int(* ck_delete)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:199
uint32 ftkey_nr
Definition: myisam.h:186
uint8 key_alg
Definition: myisam.h:178
uint16 underflow_block_length
Definition: myisam.h:180
uint16 maxlength
Definition: myisam.h:183
int(* ck_insert)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:198
uint(* get_key)(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key)
Definition: myisam.h:193
uint16 keylength
Definition: myisam.h:181
Definition: myisamdef.h:522
uchar key
Definition: myisam.h:207
HA_KEYSEG * seg
Definition: myisam.h:209
uint16 keysegs
Definition: myisam.h:206
HA_KEYSEG * end
Definition: myisam.h:209
uint8 null_are_equal
Definition: myisam.h:208
Definition: myisamdef.h:178
uchar * end
Definition: myisam.h:384
uchar * buf
Definition: myisam.h:384
int count
Definition: myisam.h:385
uchar lastkey[MI_MAX_KEY_BUFF]
Definition: myisam.h:386
SORT_FT_BUF * ft_buf
Definition: myisam.h:399
SORT_KEY_BLOCKS * key_block
Definition: myisam.h:398
MI_INFO * info
Definition: myisam.h:395
my_off_t filelength
Definition: myisam.h:390
uchar * buff
Definition: myisam.h:397
uint current_key
Definition: myisam.h:392
myf myf_rw
Definition: myisam.h:393
my_off_t dupp
Definition: myisam.h:390
uint total_keys
Definition: myisam.h:392
SORT_KEY_BLOCKS * key_block_end
Definition: myisam.h:398
ha_rows max_records
Definition: myisam.h:391
my_off_t buff_length
Definition: myisam.h:390
data_file_type new_data_file_type
Definition: myisam.h:394
MI_CHECK * param
Definition: myisam.h:396
uchar * end_pos
Definition: myisam.h:322
uint last_length
Definition: myisam.h:324
uchar * buff
Definition: myisam.h:322
uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF]
Definition: myisam.h:323
int inited
Definition: myisam.h:325
Definition: my_base.h:1125
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: keycache.h:50
Definition: plugin_ftparser.h:216
Include file for Sun RPC to compile out of the box.
static uint64_t cache_size
Definition: xcom_cache.cc:362