53#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY
54#define MI_MAX_KEY HA_MAX_POSSIBLE_KEY
56#define MI_MAX_KEY MAX_INDEXES
59#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
64#define MI_MAX_KEY_LENGTH 1000
65#define MI_MAX_KEY_SEG 16
67#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH + MI_MAX_KEY_SEG * 6 + 8 + 8)
68#define MI_MAX_MSG_BUF 1024
69#define MI_NAME_IEXT ".MYI"
70#define MI_NAME_DEXT ".MYD"
73#define MI_KEY_BLOCK_LENGTH 1024U
74#define MI_MIN_KEY_BLOCK_LENGTH 1024U
75#define MI_MAX_KEY_BLOCK_LENGTH 16384U
84#define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
85#define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
86#define mi_get_mask_all_keys_active(_keys_) \
87 (((_keys_) < MI_KEYMAP_BITS) ? ((1ULL << (_keys_)) - 1ULL) : (~0ULL))
89#if MI_MAX_KEY > MI_KEYMAP_BITS
92 return (((_keyno_) <
MI_KEYMAP_BITS) ? ((_keymap_) & (1ULL << (_keyno_)))
96#define mi_set_key_active(_keymap_, _keyno_) \
97 (_keymap_) |= (((_keyno_) < MI_KEYMAP_BITS) ? (1ULL << (_keyno_)) \
98 : MI_KEYMAP_HIGH_MASK)
99#define mi_clear_key_active(_keymap_, _keyno_) \
100 (_keymap_) &= (((_keyno_) < MI_KEYMAP_BITS) ? (~(1ULL << (_keyno_))) \
106 return ((_keymap_) & (1ULL << (_keyno_)));
108#define mi_set_key_active(_keymap_, _keyno_) (_keymap_) |= (1ULL << (_keyno_))
109#define mi_clear_key_active(_keymap_, _keyno_) \
110 (_keymap_) &= (~(1ULL << (_keyno_)))
115#define mi_is_all_keys_active(_keymap_, _keys_) \
116 ((_keymap_) == mi_get_mask_all_keys_active(_keys_))
117#define mi_set_all_keys_active(_keymap_, _keys_) \
118 (_keymap_) = mi_get_mask_all_keys_active(_keys_)
119#define mi_clear_all_keys_active(_keymap_) (_keymap_) = 0
120#define mi_intersect_keys_active(_to_, _from_) (_to_) &= (_from_)
121#define mi_is_any_intersect_keys_active(_keymap1_, _keys_, _keymap2_) \
122 ((_keymap1_) & (_keymap2_)&mi_get_mask_all_keys_active(_keys_))
123#define mi_copy_keys_active(_to_, _maxkeys_, _from_) \
124 (_to_) = (mi_get_mask_all_keys_active(_maxkeys_) & (_from_))
203#define MI_UNIQUE_HASH_LENGTH 4
259#define mi_close(file) mi_close_share(file, NULL)
263#define mi_open(name, mode, wait_if_locked) \
264 mi_open_share(name, NULL, mode, wait_if_locked)
289extern int mi_rename(
const char *from,
const char *to);
295extern int mi_log(
int activate_log);
301#define MEMMAP_EXTRA_MARGIN 7
304#define MYISAMCHK_REPAIR 1
305#define MYISAMCHK_VERIFY 2
313#define TT_FOR_UPGRADE 2
415 int rep_quick,
bool no_copy_stat);
417 const char *new_ext,
myf myflags);
class to copying an field/item to a key struct
Definition: sql_select.h:810
int page
Definition: ctype-mb.cc:1236
#define MY_WAIT_IF_FULL
Definition: my_sys.h:124
#define MY_NABP
Definition: my_sys.h:121
#define MY_WME
Definition: my_sys.h:123
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
static uint keys
Definition: hp_test2.cc:46
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:177
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:1143
ha_panic_function
Definition: my_base.h:431
data_file_type
Definition: my_base.h:1069
@ STATIC_RECORD
Definition: my_base.h:1070
ha_rkey_function
Definition: my_base.h:78
ulong key_part_map
Definition: my_base.h:1007
my_off_t ha_rows
Definition: my_base.h:1140
ha_extra_function
Definition: my_base.h:184
en_fieldtype
Definition: my_base.h:1054
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:1701
int filecopy(MI_CHECK *param, File to, File from, my_off_t start, my_off_t length, const char *type)
Definition: mi_check.cc:1966
int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
Definition: mi_check.cc:3315
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:376
int mi_rlast(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rlast.cc:30
#define MI_KEYMAP_BITS
Definition: myisam.h:84
int test_if_almost_full(MI_INFO *info)
Definition: mi_check.cc:3305
my_off_t mi_position(MI_INFO *file)
Definition: mi_info.cc:39
ulong myisam_block_size
Definition: mi_static.cc:57
const char * myisam_log_filename
Definition: mi_static.cc:54
my_off_t myisam_max_temp_length
Definition: mi_static.cc:62
int(* myisam_test_invalid_symlink)(const char *filename)
Definition: mi_static.cc:72
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:2015
int mi_rnext_same(MI_INFO *info, uchar *buf)
Definition: mi_rnext_same.cc:39
ulonglong myisam_mmap_size
Definition: mi_static.cc:64
#define MI_MAX_POSSIBLE_KEY_BUFF
Definition: myisam.h:59
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:888
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:335
@ MI_STATS_METHOD_IGNORE_NULLS
Definition: myisam.h:341
@ MI_STATS_METHOD_NULLS_EQUAL
Definition: myisam.h:339
@ MI_STATS_METHOD_NULLS_NOT_EQUAL
Definition: myisam.h:337
uint mi_get_pointer_length(ulonglong file_length, uint def)
Definition: mi_create.cc:777
ulong myisam_data_pointer_size
Definition: mi_static.cc:63
ulong myisam_concurrent_insert
Definition: mi_static.cc:61
#define MI_MAX_KEY_SEG
Definition: myisam.h:65
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:3467
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, ulonglong *unique, ulonglong *notnull, ulonglong records)
Definition: mi_check.cc:3649
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:246
MI_INFO * mi_open_share(const char *name, MYISAM_SHARE *old_share, int mode, uint wait_if_locked)
Definition: mi_open.cc:100
st_keycache_thread_var main_thread_keycache_var
Definition: mi_static.cc:66
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, bool repair)
Definition: mi_check.cc:3551
int lock_file(MI_CHECK *param, File file, int lock_type, const char *filetype, const char *filename)
Definition: mi_check.cc:1950
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:105
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:132
int chk_size(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:317
void mi_end_bulk_insert(MI_INFO *info)
Definition: mi_write.cc:925
#define MI_KEYMAP_HIGH_MASK
Definition: myisam.h:85
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:58
int mi_rnext(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rnext.cc:38
#define MI_MAX_KEY_BUFF
Definition: myisam.h:67
int update_state_info(MI_CHECK *param, MI_INFO *info, uint update)
Definition: mi_check.cc:3485
int chk_del(MI_CHECK *param, MI_INFO *info, uint test_flag)
Definition: mi_check.cc:157
int mi_reset(MI_INFO *file)
Definition: mi_extra.cc:237
bool mi_is_any_key_active(uint64 _keymap_)
Definition: myisam.h:114
int change_to_newfile(const char *filename, const char *old_ext, const char *new_ext, myf myflags)
Definition: mi_check.cc:1937
int mi_scan_init(MI_INFO *file)
Definition: mi_scan.cc:30
void myisamchk_init(MI_CHECK *param)
Definition: mi_check.cc:111
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:1406
ulong _mi_calc_blob_length(uint length, const uchar *pos)
Definition: mi_dynrec.cc:1166
bool myisam_delay_key_write
Definition: myisam.h:246
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
Definition: mi_check.cc:3725
ulonglong myisam_mmap_used
Definition: myisam.h:253
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:1749
st_keycache_thread_var * keycache_thread_var()
Definition: ha_myisam.cc:1922
bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, bool force)
Definition: mi_check.cc:3748
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:91
static int record
Definition: mysqltest.cc:188
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:49
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
mode
Definition: file_handle.h:60
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:33
Definition: my_compare.h:60
Definition: keycache.h:73
Definition: myisamdef.h:243
const char * db_name
Definition: myisam.h:379
my_off_t key_blocks
Definition: myisam.h:352
ulonglong auto_increment_value
Definition: myisam.h:345
my_off_t search_after_block
Definition: myisam.h:350
char temp_filename[FN_REFLEN]
Definition: myisam.h:363
my_off_t start_check_pos
Definition: myisam.h:352
ha_checksum key_crc[HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:376
ha_rows total_deleted
Definition: myisam.h:353
uint out_flag
Definition: myisam.h:357
ulonglong max_record_length
Definition: myisam.h:348
ulonglong use_buffers
Definition: myisam.h:355
const char * table_name
Definition: myisam.h:379
uint error_printed
Definition: myisam.h:357
bool force_sort
Definition: myisam.h:362
uint16 language
Definition: myisam.h:360
bool using_global_keycache
Definition: myisam.h:361
uint opt_sort_key
Definition: myisam.h:358
ulong write_buffer_length
Definition: myisam.h:356
uint max_level
Definition: myisam.h:358
uint testflag
Definition: myisam.h:359
ulong rec_per_key_part[MI_MAX_KEY_SEG *HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:377
bool opt_follow_links
Definition: myisam.h:361
ha_checksum glob_crc
Definition: myisam.h:354
ulonglong unique_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:373
ulonglong keys_in_use
Definition: myisam.h:347
ulong sort_key_blocks
Definition: myisam.h:356
const char * op_name
Definition: myisam.h:380
char * isam_file_name
Definition: myisam.h:363
ulonglong notnull_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:374
ulonglong max_data_file_length
Definition: myisam.h:346
int tmpfile_createflag
Definition: myisam.h:365
uint key_cache_block_size
Definition: myisam.h:359
ha_checksum record_checksum
Definition: myisam.h:354
IO_CACHE read_cache
Definition: myisam.h:367
ha_rows total_records
Definition: myisam.h:353
void * thd
Definition: myisam.h:378
my_off_t totaldata
Definition: myisam.h:352
uint verbose
Definition: myisam.h:357
ulonglong sort_buffer_length
Definition: myisam.h:349
uint total_files
Definition: myisam.h:358
my_off_t new_file_pos
Definition: myisam.h:351
bool retry_repair
Definition: myisam.h:362
uint warning_printed
Definition: myisam.h:357
ulong read_buffer_length
Definition: myisam.h:356
my_off_t key_file_blocks
Definition: myisam.h:351
enum_mi_stats_method stats_method
Definition: myisam.h:381
my_off_t keydata
Definition: myisam.h:352
MY_TMPDIR * tmpdir
Definition: myisam.h:364
myf myf_rw
Definition: myisam.h:366
uint16 null_pos
Definition: myisam.h:234
MI_DECODE_TREE * huff_tree
Definition: myisam.h:240
uint32 offset
Definition: myisam.h:232
void(* unpack)(MI_COLUMNDEF *rec, MI_BIT_BUFF *buff, uchar *start, uchar *end)
Definition: myisam.h:236
int16 type
Definition: myisam.h:230
uint pack_type
Definition: myisam.h:239
enum en_fieldtype base_type
Definition: myisam.h:238
uint space_length_bits
Definition: myisam.h:239
uint16 length
Definition: myisam.h:231
uint8 null_bit
Definition: myisam.h:233
ulonglong data_file_length
Definition: myisam.h:161
uint16 language
Definition: myisam.h:164
ulonglong key_file_length
Definition: myisam.h:162
uint old_options
Definition: myisam.h:163
const char * index_file_name
Definition: myisam.h:157
bool with_auto_increment
Definition: myisam.h:165
ha_rows reloc_rows
Definition: myisam.h:159
const char * data_file_name
Definition: myisam.h:157
ha_rows max_rows
Definition: myisam.h:158
ulonglong auto_increment
Definition: myisam.h:160
uchar * intervalls
Definition: myisam.h:217
uint quick_table_bits
Definition: myisam.h:216
uint16 * table
Definition: myisam.h:215
Definition: myisamdef.h:252
char * data_file_name
Definition: myisam.h:142
uint keys
Definition: myisam.h:143
my_off_t max_index_file_length
Definition: myisam.h:136
time_t create_time
Definition: myisam.h:148
ulonglong key_map
Definition: myisam.h:141
int sortkey
Definition: myisam.h:146
uint reflength
Definition: myisam.h:151
my_off_t newrecpos
Definition: myisam.h:133
my_off_t recpos
Definition: myisam.h:132
ulong reclength
Definition: myisam.h:138
my_off_t max_data_file_length
Definition: myisam.h:136
ulong record_offset
Definition: myisam.h:152
my_off_t data_file_length
Definition: myisam.h:135
ulonglong auto_increment
Definition: myisam.h:140
time_t update_time
Definition: myisam.h:150
ulong mean_reclength
Definition: myisam.h:139
ha_rows deleted
Definition: myisam.h:131
int errkey
Definition: myisam.h:145
ulong * rec_per_key
Definition: myisam.h:153
my_off_t index_file_length
Definition: myisam.h:136
char * index_file_name
Definition: myisam.h:142
ha_rows records
Definition: myisam.h:130
time_t check_time
Definition: myisam.h:149
File filenr
Definition: myisam.h:147
my_off_t delete_length
Definition: myisam.h:137
my_off_t dupp_key_pos
Definition: myisam.h:134
uint16 keysegs
Definition: myisam.h:176
MYISAM_SHARE * share
Definition: myisam.h:175
uint32 version
Definition: myisam.h:186
uint16 block_size_index
Definition: myisam.h:185
HA_KEYSEG * seg
Definition: myisam.h:189
uint16 block_length
Definition: myisam.h:180
uint16 flag
Definition: myisam.h:177
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:195
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:191
struct st_mysql_ftparser * parser
Definition: myisam.h:190
uint16 minlength
Definition: myisam.h:183
HA_KEYSEG * end
Definition: myisam.h:189
int(* ck_delete)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:200
uint32 ftkey_nr
Definition: myisam.h:187
uint8 key_alg
Definition: myisam.h:179
uint16 underflow_block_length
Definition: myisam.h:181
uint16 maxlength
Definition: myisam.h:184
int(* ck_insert)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:199
uint(* get_key)(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key)
Definition: myisam.h:194
uint16 keylength
Definition: myisam.h:182
Definition: myisamdef.h:521
uchar key
Definition: myisam.h:208
HA_KEYSEG * seg
Definition: myisam.h:210
uint16 keysegs
Definition: myisam.h:207
HA_KEYSEG * end
Definition: myisam.h:210
uint8 null_are_equal
Definition: myisam.h:209
Definition: myisamdef.h:177
uchar * end
Definition: myisam.h:385
uchar * buf
Definition: myisam.h:385
int count
Definition: myisam.h:386
uchar lastkey[MI_MAX_KEY_BUFF]
Definition: myisam.h:387
SORT_FT_BUF * ft_buf
Definition: myisam.h:400
SORT_KEY_BLOCKS * key_block
Definition: myisam.h:399
MI_INFO * info
Definition: myisam.h:396
my_off_t filelength
Definition: myisam.h:391
uchar * buff
Definition: myisam.h:398
uint current_key
Definition: myisam.h:393
myf myf_rw
Definition: myisam.h:394
my_off_t dupp
Definition: myisam.h:391
uint total_keys
Definition: myisam.h:393
SORT_KEY_BLOCKS * key_block_end
Definition: myisam.h:399
ha_rows max_records
Definition: myisam.h:392
my_off_t buff_length
Definition: myisam.h:391
data_file_type new_data_file_type
Definition: myisam.h:395
MI_CHECK * param
Definition: myisam.h:397
uchar * end_pos
Definition: myisam.h:323
uint last_length
Definition: myisam.h:325
uchar * buff
Definition: myisam.h:323
uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF]
Definition: myisam.h:324
int inited
Definition: myisam.h:326
Definition: my_base.h:1124
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: keycache.h:50
Definition: plugin_ftparser.h:212
Include file for Sun RPC to compile out of the box.
unsigned int uint
Definition: uca9-dump.cc:75
static uint64_t cache_size
Definition: xcom_cache.cc:362