MySQL 8.4.2
Source Code Documentation
|
#include "my_alloc.h"
#include "my_checksum.h"
#include "my_icp.h"
#include "my_inttypes.h"
#include "my_pointer_arithmetic.h"
#include "myisam.h"
#include "myisampack.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/psi/mysql_rwlock.h"
#include "mysql/psi/mysql_thread.h"
#include "thr_lock.h"
Go to the source code of this file.
Classes | |
struct | MI_STATUS_INFO |
struct | MI_STATE_INFO |
struct | MI_BASE_INFO |
struct | MI_BLOB |
struct | MI_PACK |
struct | MYISAM_SHARE |
struct | MI_BIT_BUFF |
struct | MI_INFO |
struct | BUFFPEK |
struct | MI_SORT_PARAM |
struct | MI_KEY_PARAM |
struct | MI_BLOCK_INFO |
Macros | |
#define | MI_STATE_INFO_SIZE (24 + 14 * 8 + 7 * 4 + 2 * 2 + 8) |
#define | MI_STATE_KEY_SIZE 8 |
#define | MI_STATE_KEYBLOCK_SIZE 8 |
#define | MI_STATE_KEYSEG_SIZE 4 |
#define | MI_STATE_EXTRA_SIZE |
#define | MI_KEYDEF_SIZE (2 + 5 * 2) |
#define | MI_UNIQUEDEF_SIZE (2 + 1 + 1) |
#define | HA_KEYSEG_SIZE (6 + 2 * 2 + 4 * 2) |
#define | MI_COLUMNDEF_SIZE (2 * 3 + 1) |
#define | MI_BASE_INFO_SIZE (5 * 8 + 8 * 4 + 4 + 4 * 2 + 16) |
#define | MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */ |
#define | MAX_NONMAPPED_INSERTS 1000 |
#define | USE_WHOLE_KEY MI_MAX_KEY_BUFF * 2 /* Use whole key in _mi_search() */ |
#define | F_EXTRA_LCK -1 |
#define | MEMMAP_USED 32 |
#define | REMEMBER_OLD_POS 64 |
#define | WRITEINFO_UPDATE_KEYFILE 1 |
#define | WRITEINFO_NO_UNLOCK 2 |
#define | USE_PACKED_KEYS 1 |
#define | RRND_PRESERVE_LASTINX 2 |
#define | STATE_CHANGED 1 |
#define | STATE_CRASHED 2 |
#define | STATE_CRASHED_ON_REPAIR 4 |
#define | STATE_NOT_ANALYZED 8 |
#define | STATE_NOT_OPTIMIZED_KEYS 16 |
#define | STATE_NOT_SORTED_PAGES 32 |
#define | READING_NEXT 1 |
#define | READING_HEADER 2 |
#define | mi_getint(x) ((uint)mi_uint2korr(x) & 32767) |
#define | mi_putint(x, y, nod) |
#define | mi_test_if_nod(x) (x[0] & 128 ? info->s->base.key_reflength : 0) |
#define | mi_report_crashed(A, B) _mi_report_crashed((A), (B), __FILE__, __LINE__) |
#define | mi_mark_crashed(x) |
#define | mi_mark_crashed_on_repair(x) |
#define | mi_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED) |
#define | mi_is_crashed_on_repair(x) ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR) |
#define | mi_print_error(SHARE, ERRNO) mi_report_error((ERRNO), (SHARE)->index_file_name) |
#define | store_key_length(key, length) |
#define | get_key_full_length(length, key) |
#define | get_key_full_length_rdonly(length, key) |
#define | get_pack_length(length) ((length) >= 255 ? 3 : 1) |
#define | MI_MIN_BLOCK_LENGTH 20U /* Because of delete-link */ |
#define | MI_EXTEND_BLOCK_LENGTH 20 /* Don't use to small record-blocks */ |
#define | MI_SPLIT_LENGTH ((MI_EXTEND_BLOCK_LENGTH + 4) * 2) |
#define | MI_MAX_DYN_BLOCK_HEADER 20 /* Max prefix of record-block */ |
#define | MI_BLOCK_INFO_HEADER_LENGTH 20 |
#define | MI_DYN_DELETE_BLOCK_HEADER 20 /* length of delete-block-header */ |
#define | MI_DYN_MAX_BLOCK_LENGTH ((1L << 24) - 4L) |
#define | MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH) |
#define | MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */ |
#define | MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */ |
#define | MI_MAX_BLOCK_LENGTH ((((ulong)1 << 24) - 1) & (~(ulong)(MI_DYN_ALIGN_SIZE - 1))) |
#define | MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER + sizeof(uint32)) |
#define | PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */ |
#define | PACK_TYPE_SPACE_FIELDS 2 |
#define | PACK_TYPE_ZERO_FILL 4 |
#define | MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */ |
#define | MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH / MI_MIN_KEY_BLOCK_LENGTH) |
#define | MI_BLOCK_SIZE(key_length, data_pointer, key_pointer, block_size) |
#define | MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ |
#define | MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ |
#define | MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */ |
#define | MI_MIN_ROWS_TO_USE_BULK_INSERT 100 |
#define | MI_MIN_ROWS_TO_DISABLE_INDEXES 100 |
#define | MI_MIN_ROWS_TO_USE_WRITE_CACHE 10 |
#define | MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT |
#define | mi_unique_store(A, B) mi_int4store((A), (B)) |
#define | mi_get_rec_buff_ptr(info, buf) |
#define | mi_get_rec_buff_len(info, buf) (*((uint32 *)(mi_get_rec_buff_ptr(info, buf)))) |
#define | BLOCK_FIRST 1 |
#define | BLOCK_LAST 2 |
#define | BLOCK_DELETED 4 |
#define | BLOCK_ERROR 8 /* Wrong data */ |
#define | BLOCK_SYNC_ERROR 16 /* Right data at wrong place */ |
#define | BLOCK_FATAL_ERROR 32 /* hardware-error */ |
#define | NEED_MEM |
#define | MAXERR 20 |
#define | BUFFERS_WHEN_SORTING 16 /* Alloc for sort-key-tree */ |
#define | MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ |
#define | WRITE_COUNT MY_HOW_OFTEN_TO_WRITE |
#define | INDEX_TMP_EXT ".TMM" |
#define | DATA_TMP_EXT ".TMD" |
#define | UPDATE_TIME 1 |
#define | UPDATE_STAT 2 |
#define | UPDATE_SORT 4 |
#define | UPDATE_AUTO_INC 8 |
#define | UPDATE_OPEN_COUNT 16 |
#define | USE_BUFFER_INIT (((1024L * 512L - MALLOC_OVERHEAD) / IO_SIZE) * IO_SIZE) |
#define | READ_BUFFER_INIT (1024L * 256L - MALLOC_OVERHEAD) |
#define | SORT_BUFFER_INIT (2048L * 1024L - MALLOC_OVERHEAD) |
#define | MIN_SORT_BUFFER (4096ULL - MALLOC_OVERHEAD) |
#define | myisam_log(a, b, c, d) if (myisam_log_file >= 0) _myisam_log(a, b, c, d) |
#define | myisam_log_command(a, b, c, d, e) if (myisam_log_file >= 0) _myisam_log_command(a, b, c, d, e) |
#define | myisam_log_record(a, b, c, d, e) if (myisam_log_file >= 0) _myisam_log_record(a, b, c, d, e) |
#define | fast_mi_writeinfo(INFO) if (!(INFO)->s->tot_locks) (void)_mi_writeinfo((INFO), 0) |
#define | fast_mi_readinfo(INFO) ((INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO), F_RDLCK, 1) |
Typedefs | |
typedef uint | mi_bit_type |
typedef ICP_RESULT(* | index_cond_func_t) (void *param) |
Enumerations | |
enum | myisam_log_commands { MI_LOG_OPEN , MI_LOG_WRITE , MI_LOG_UPDATE , MI_LOG_DELETE , MI_LOG_CLOSE , MI_LOG_EXTRA , MI_LOG_LOCK , MI_LOG_DELETE_ALL } |
Functions | |
int | _mi_read_dynamic_record (MI_INFO *info, my_off_t filepos, uchar *buf) |
int | _mi_write_dynamic_record (MI_INFO *, const uchar *) |
int | _mi_update_dynamic_record (MI_INFO *, my_off_t, const uchar *) |
int | _mi_delete_dynamic_record (MI_INFO *info) |
int | _mi_cmp_dynamic_record (MI_INFO *info, const uchar *record) |
int | _mi_read_rnd_dynamic_record (MI_INFO *, uchar *, my_off_t, bool) |
int | _mi_write_blob_record (MI_INFO *, const uchar *) |
int | _mi_update_blob_record (MI_INFO *, my_off_t, const uchar *) |
int | _mi_read_static_record (MI_INFO *info, my_off_t filepos, uchar *buf) |
int | _mi_write_static_record (MI_INFO *, const uchar *) |
int | _mi_update_static_record (MI_INFO *, my_off_t, const uchar *) |
int | _mi_delete_static_record (MI_INFO *info) |
int | _mi_cmp_static_record (MI_INFO *info, const uchar *record) |
int | _mi_read_rnd_static_record (MI_INFO *, uchar *, my_off_t, bool) |
int | _mi_ck_write (MI_INFO *info, uint keynr, uchar *key, uint length) |
int | _mi_ck_real_write_btree (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, my_off_t *root, uint comp_flag) |
int | _mi_enlarge_root (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, my_off_t *root) |
int | _mi_insert (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *anc_buff, uchar *key_pos, uchar *key_buff, uchar *father_buff, uchar *father_keypos, my_off_t father_page, bool insert_last) |
int | _mi_split_page (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *buff, uchar *key_buff, bool insert_last) |
uchar * | _mi_find_half_pos (uint nod_flag, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint *return_key_length, uchar **after_key) |
int | _mi_calc_static_key_length (MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *key_buff, const uchar *key, MI_KEY_PARAM *s_temp) |
int | _mi_calc_var_key_length (MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *key_buff, const uchar *key, MI_KEY_PARAM *s_temp) |
int | _mi_calc_var_pack_key_length (MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp) |
int | _mi_calc_bin_pack_key_length (MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp) |
void | _mi_store_static_key (MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp) |
void | _mi_store_var_pack_key (MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp) |
void | _mi_store_bin_pack_key (MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp) |
int | _mi_ck_delete (MI_INFO *info, uint keynr, uchar *key, uint key_length) |
int | _mi_readinfo (MI_INFO *info, int lock_flag, int check_keybuffer) |
int | _mi_writeinfo (MI_INFO *info, uint options) |
int | _mi_test_if_changed (MI_INFO *info) |
int | _mi_mark_file_changed (MI_INFO *info) |
int | _mi_decrement_open_count (MI_INFO *info) |
int | _mi_check_index (MI_INFO *info, int inx) |
int | _mi_search (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_len, uint nextflag, my_off_t pos) |
int | _mi_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) |
int | _mi_seq_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) |
int | _mi_prefix_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) |
my_off_t | _mi_kpos (uint nod_flag, uchar *after_key) |
void | _mi_kpointer (MI_INFO *info, uchar *buff, my_off_t pos) |
my_off_t | _mi_dpos (MI_INFO *info, uint nod_flag, const uchar *after_key) |
my_off_t | _mi_rec_pos (MYISAM_SHARE *info, uchar *ptr) |
void | _mi_dpointer (MI_INFO *info, uchar *buff, my_off_t pos) |
uint | _mi_get_static_key (MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key) |
uint | _mi_get_pack_key (MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key) |
uint | _mi_get_binary_pack_key (MI_KEYDEF *keyinfo, uint nod_flag, uchar **page_pos, uchar *key) |
uchar * | _mi_get_last_key (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *keypos, uchar *lastkey, uchar *endpos, uint *return_key_length) |
uchar * | _mi_get_key (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uchar *keypos, uint *return_key_length) |
uint | _mi_keylength (MI_KEYDEF *keyinfo, const uchar *key) |
uint | _mi_keylength_part (MI_KEYDEF *keyinfo, const uchar *key, HA_KEYSEG *end) |
uchar * | _mi_move_key (MI_KEYDEF *keyinfo, uchar *to, const uchar *from) |
int | _mi_search_next (MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, uint nextflag, my_off_t pos) |
int | _mi_search_first (MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos) |
int | _mi_search_last (MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos) |
uchar * | _mi_fetch_keypage (MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, int level, uchar *buff, int return_buffer) |
int | _mi_write_keypage (MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, int level, uchar *buff) |
int | _mi_dispose (MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos, int level) |
my_off_t | _mi_new (MI_INFO *info, MI_KEYDEF *keyinfo, int level) |
uint | _mi_make_key (MI_INFO *info, uint keynr, uchar *key, const uchar *record, my_off_t filepos) |
uint | _mi_pack_key (MI_INFO *info, uint keynr, uchar *key, const uchar *old, key_part_map keypart_map, HA_KEYSEG **last_used_keyseg) |
int | _mi_read_key_record (MI_INFO *info, my_off_t filepos, uchar *buf) |
int | _mi_read_cache (IO_CACHE *info, uchar *buff, my_off_t pos, uint length, int re_read_if_possibly) |
ulonglong | retrieve_auto_increment (MI_INFO *info, const uchar *record) |
uchar * | mi_alloc_rec_buff (MI_INFO *, ulong, uchar **) |
size_t | _mi_rec_unpack (MI_INFO *info, uchar *to, const uchar *from, ulong reclength) |
bool | _mi_rec_check (MI_INFO *info, const uchar *record, uchar *packpos, ulong packed_length, bool with_checkum) |
int | _mi_write_part_record (MI_INFO *info, my_off_t filepos, ulong length, my_off_t next_filepos, uchar **record, ulong *reclength, int *flag) |
void | _mi_print_key (FILE *stream, HA_KEYSEG *keyseg, const uchar *key, uint length) |
bool | _mi_read_pack_info (MI_INFO *info, bool fix_keys) |
int | _mi_read_pack_record (MI_INFO *info, my_off_t filepos, uchar *buf) |
int | _mi_read_rnd_pack_record (MI_INFO *, uchar *, my_off_t, bool) |
int | _mi_pack_rec_unpack (MI_INFO *info, MI_BIT_BUFF *bit_buff, uchar *to, uchar *from, ulong reclength) |
ulonglong | mi_safe_mul (ulonglong a, ulonglong b) |
int | _mi_ft_update (MI_INFO *info, uint keynr, uchar *keybuf, const uchar *oldrec, const uchar *newrec, my_off_t pos) |
uint | _mi_get_block_info (MI_BLOCK_INFO *, File, my_off_t) |
uint | _mi_rec_pack (MI_INFO *info, uchar *to, const uchar *from) |
uint | _mi_pack_get_block_info (MI_INFO *myisam, MI_BIT_BUFF *bit_buff, MI_BLOCK_INFO *info, uchar **rec_buff_p, File file, my_off_t filepos) |
void | _mi_store_blob_length (uchar *pos, uint pack_length, uint length) |
void | _myisam_log (enum myisam_log_commands command, MI_INFO *info, const uchar *buffert, uint length) |
void | _myisam_log_command (enum myisam_log_commands command, MI_INFO *info, const uchar *buffert, uint length, int result) |
void | _myisam_log_record (enum myisam_log_commands command, MI_INFO *info, const uchar *record, my_off_t filepos, int result) |
void | mi_report_error (int errcode, const char *file_name) |
bool | _mi_memmap_file (MI_INFO *info) |
void | _mi_unmap_file (MI_INFO *info) |
uint | save_pack_length (uint version, uchar *block_buff, ulong length) |
uint | read_pack_length (uint version, const uchar *buf, ulong *length) |
uint | calc_pack_length (uint version, ulong length) |
size_t | mi_mmap_pread (MI_INFO *info, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) |
size_t | mi_mmap_pwrite (MI_INFO *info, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) |
size_t | mi_nommap_pread (MI_INFO *info, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) |
size_t | mi_nommap_pwrite (MI_INFO *info, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) |
uint | mi_state_info_write (File file, MI_STATE_INFO *state, uint pWrite) |
uchar * | mi_state_info_read (uchar *ptr, MI_STATE_INFO *state) |
uint | mi_state_info_read_dsk (File file, MI_STATE_INFO *state, bool pRead) |
uint | mi_base_info_write (File file, MI_BASE_INFO *base) |
uchar * | my_n_base_info_read (uchar *ptr, MI_BASE_INFO *base) |
int | mi_keyseg_write (File file, const HA_KEYSEG *keyseg) |
uchar * | mi_keyseg_read (uchar *ptr, HA_KEYSEG *keyseg) |
uint | mi_keydef_write (File file, MI_KEYDEF *keydef) |
uchar * | mi_keydef_read (uchar *ptr, MI_KEYDEF *keydef) |
uint | mi_uniquedef_write (File file, MI_UNIQUEDEF *keydef) |
uchar * | mi_uniquedef_read (uchar *ptr, MI_UNIQUEDEF *keydef) |
uint | mi_recinfo_write (File file, MI_COLUMNDEF *recinfo) |
uchar * | mi_recinfo_read (uchar *ptr, MI_COLUMNDEF *recinfo) |
int | mi_disable_indexes (MI_INFO *info) |
int | mi_enable_indexes (MI_INFO *info) |
int | mi_indexes_are_disabled (MI_INFO *info) |
ulong | _my_calc_total_blob_length (MI_INFO *info, const uchar *record) |
ha_checksum | mi_checksum (MI_INFO *info, const uchar *buf) |
ha_checksum | mi_static_checksum (MI_INFO *info, const uchar *buf) |
bool | mi_check_unique (MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, ha_checksum unique_hash, my_off_t pos) |
ha_checksum | mi_unique_hash (MI_UNIQUEDEF *def, const uchar *buf) |
int | _mi_cmp_static_unique (MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos) |
int | _mi_cmp_dynamic_unique (MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos) |
int | mi_unique_comp (MI_UNIQUEDEF *def, const uchar *a, const uchar *b, bool null_are_equal) |
void | mi_get_status (void *param, int concurrent_insert) |
void | mi_update_status (void *param) |
void | mi_restore_status (void *param) |
void | mi_copy_status (void *to, void *from) |
bool | mi_check_status (void *param) |
MI_INFO * | test_if_reopen (char *filename) |
bool | check_table_is_closed (const char *name, const char *where) |
int | mi_open_datafile (MI_INFO *info, MYISAM_SHARE *share, const char *orn_name, File file_to_dup) |
int | mi_open_keyfile (MYISAM_SHARE *share) |
void | mi_setup_functions (MYISAM_SHARE *share) |
bool | mi_dynmap_file (MI_INFO *info, my_off_t size) |
int | mi_munmap_file (MI_INFO *info) |
void | mi_remap_file (MI_INFO *info, my_off_t size) |
void | _mi_report_crashed (MI_INFO *file, const char *message, const char *sfile, uint sline) |
Report list of threads (and queries) accessing a table, thread_id of a thread that detected corruption, ource file name and line number where this corruption was detected, optional extra information (string). More... | |
int | mi_check_index_cond (MI_INFO *info, uint keynr, uchar *record) |
volatile int * | killed_ptr (MI_CHECK *param) |
void | mi_check_print_error (MI_CHECK *param, const char *fmt,...) |
void | mi_check_print_warning (MI_CHECK *param, const char *fmt,...) |
void | mi_check_print_info (MI_CHECK *param, const char *fmt,...) |
int | flush_pending_blocks (MI_SORT_PARAM *param) |
int | sort_ft_buf_flush (MI_SORT_PARAM *sort_param) |
int | flush_blocks (MI_CHECK *param, KEY_CACHE *key_cache, File file) |
int | sort_write_record (MI_SORT_PARAM *sort_param) |
int | _create_index_by_sort (MI_SORT_PARAM *info, bool no_messages, ulonglong) |
void | mi_set_index_cond_func (MI_INFO *info, index_cond_func_t func, void *func_arg) |
void | init_myisam_psi_keys () |
#define BLOCK_DELETED 4 |
#define BLOCK_ERROR 8 /* Wrong data */ |
#define BLOCK_FATAL_ERROR 32 /* hardware-error */ |
#define BLOCK_FIRST 1 |
#define BLOCK_LAST 2 |
#define BLOCK_SYNC_ERROR 16 /* Right data at wrong place */ |
#define BUFFERS_WHEN_SORTING 16 /* Alloc for sort-key-tree */ |
#define DATA_TMP_EXT ".TMD" |
#define F_EXTRA_LCK -1 |
#define fast_mi_readinfo | ( | INFO | ) | ((INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO), F_RDLCK, 1) |
#define fast_mi_writeinfo | ( | INFO | ) | if (!(INFO)->s->tot_locks) (void)_mi_writeinfo((INFO), 0) |
#define get_key_full_length | ( | length, | |
key | |||
) |
#define get_key_full_length_rdonly | ( | length, | |
key | |||
) |
#define get_pack_length | ( | length | ) | ((length) >= 255 ? 3 : 1) |
#define HA_KEYSEG_SIZE (6 + 2 * 2 + 4 * 2) |
#define INDEX_TMP_EXT ".TMM" |
#define MAX_NONMAPPED_INSERTS 1000 |
#define MAXERR 20 |
#define MEMMAP_USED 32 |
#define MI_BASE_INFO_SIZE (5 * 8 + 8 * 4 + 4 + 4 * 2 + 16) |
#define MI_BLOCK_INFO_HEADER_LENGTH 20 |
#define MI_BLOCK_SIZE | ( | key_length, | |
data_pointer, | |||
key_pointer, | |||
block_size | |||
) |
#define MI_COLUMNDEF_SIZE (2 * 3 + 1) |
#define MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */ |
#define MI_DYN_DELETE_BLOCK_HEADER 20 /* length of delete-block-header */ |
#define MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH) |
#define MI_EXTEND_BLOCK_LENGTH 20 /* Don't use to small record-blocks */ |
#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */ |
#define mi_get_rec_buff_len | ( | info, | |
buf | |||
) | (*((uint32 *)(mi_get_rec_buff_ptr(info, buf)))) |
#define mi_get_rec_buff_ptr | ( | info, | |
buf | |||
) |
#define mi_getint | ( | x | ) | ((uint)mi_uint2korr(x) & 32767) |
#define MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */ |
#define mi_is_crashed | ( | x | ) | ((x)->s->state.changed & STATE_CRASHED) |
#define mi_is_crashed_on_repair | ( | x | ) | ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR) |
#define MI_KEYDEF_SIZE (2 + 5 * 2) |
#define mi_mark_crashed | ( | x | ) |
#define mi_mark_crashed_on_repair | ( | x | ) |
#define MI_MAX_BLOCK_LENGTH ((((ulong)1 << 24) - 1) & (~(ulong)(MI_DYN_ALIGN_SIZE - 1))) |
#define MI_MAX_DYN_BLOCK_HEADER 20 /* Max prefix of record-block */ |
#define MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */ |
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH / MI_MIN_KEY_BLOCK_LENGTH) |
#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ |
#define MI_MIN_BLOCK_LENGTH 20U /* Because of delete-link */ |
#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ |
#define MI_MIN_ROWS_TO_DISABLE_INDEXES 100 |
#define MI_MIN_ROWS_TO_USE_BULK_INSERT 100 |
#define MI_MIN_ROWS_TO_USE_WRITE_CACHE 10 |
#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */ |
#define mi_print_error | ( | SHARE, | |
ERRNO | |||
) | mi_report_error((ERRNO), (SHARE)->index_file_name) |
#define mi_putint | ( | x, | |
y, | |||
nod | |||
) |
#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER + sizeof(uint32)) |
#define mi_report_crashed | ( | A, | |
B | |||
) | _mi_report_crashed((A), (B), __FILE__, __LINE__) |
#define MI_SPLIT_LENGTH ((MI_EXTEND_BLOCK_LENGTH + 4) * 2) |
#define MI_STATE_EXTRA_SIZE |
#define MI_STATE_INFO_SIZE (24 + 14 * 8 + 7 * 4 + 2 * 2 + 8) |
#define MI_STATE_KEY_SIZE 8 |
#define MI_STATE_KEYBLOCK_SIZE 8 |
#define MI_STATE_KEYSEG_SIZE 4 |
#define mi_test_if_nod | ( | x | ) | (x[0] & 128 ? info->s->base.key_reflength : 0) |
#define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT |
#define mi_unique_store | ( | A, | |
B | |||
) | mi_int4store((A), (B)) |
#define MI_UNIQUEDEF_SIZE (2 + 1 + 1) |
#define MIN_SORT_BUFFER (4096ULL - MALLOC_OVERHEAD) |
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ |
#define myisam_log | ( | a, | |
b, | |||
c, | |||
d | |||
) | if (myisam_log_file >= 0) _myisam_log(a, b, c, d) |
#define myisam_log_command | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | if (myisam_log_file >= 0) _myisam_log_command(a, b, c, d, e) |
#define myisam_log_record | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | if (myisam_log_file >= 0) _myisam_log_record(a, b, c, d, e) |
#define NEED_MEM |
#define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */ |
#define PACK_TYPE_SPACE_FIELDS 2 |
#define PACK_TYPE_ZERO_FILL 4 |
#define READ_BUFFER_INIT (1024L * 256L - MALLOC_OVERHEAD) |
#define READING_HEADER 2 |
#define READING_NEXT 1 |
#define REMEMBER_OLD_POS 64 |
#define RRND_PRESERVE_LASTINX 2 |
#define SORT_BUFFER_INIT (2048L * 1024L - MALLOC_OVERHEAD) |
#define STATE_CHANGED 1 |
#define STATE_CRASHED 2 |
#define STATE_CRASHED_ON_REPAIR 4 |
#define STATE_NOT_ANALYZED 8 |
#define STATE_NOT_OPTIMIZED_KEYS 16 |
#define STATE_NOT_SORTED_PAGES 32 |
#define store_key_length | ( | key, | |
length | |||
) |
#define UPDATE_AUTO_INC 8 |
#define UPDATE_OPEN_COUNT 16 |
#define UPDATE_SORT 4 |
#define UPDATE_STAT 2 |
#define UPDATE_TIME 1 |
#define USE_BUFFER_INIT (((1024L * 512L - MALLOC_OVERHEAD) / IO_SIZE) * IO_SIZE) |
#define USE_PACKED_KEYS 1 |
#define USE_WHOLE_KEY MI_MAX_KEY_BUFF * 2 /* Use whole key in _mi_search() */ |
#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE |
#define WRITEINFO_NO_UNLOCK 2 |
#define WRITEINFO_UPDATE_KEYFILE 1 |
typedef ICP_RESULT(* index_cond_func_t) (void *param) |
typedef uint mi_bit_type |
enum myisam_log_commands |
int _create_index_by_sort | ( | MI_SORT_PARAM * | info, |
bool | no_messages, | ||
ulonglong | sortbuff_size | ||
) |
int _mi_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 | ||
) |
int _mi_calc_bin_pack_key_length | ( | MI_KEYDEF * | keyinfo, |
uint | nod_flag, | ||
const uchar * | key_pos, | ||
uchar * | org_key, | ||
uchar * | prev_key, | ||
const uchar * | key, | ||
MI_KEY_PARAM * | s_temp | ||
) |
int _mi_calc_static_key_length | ( | MI_KEYDEF * | keyinfo, |
uint | nod_flag, | ||
const uchar * | key_pos, | ||
uchar * | org_key, | ||
uchar * | key_buff, | ||
const uchar * | key, | ||
MI_KEY_PARAM * | s_temp | ||
) |
int _mi_calc_var_key_length | ( | MI_KEYDEF * | keyinfo, |
uint | nod_flag, | ||
const uchar * | key_pos, | ||
uchar * | org_key, | ||
uchar * | key_buff, | ||
const uchar * | key, | ||
MI_KEY_PARAM * | s_temp | ||
) |
int _mi_calc_var_pack_key_length | ( | MI_KEYDEF * | keyinfo, |
uint | nod_flag, | ||
const uchar * | key_pos, | ||
uchar * | org_key, | ||
uchar * | prev_key, | ||
const uchar * | key, | ||
MI_KEY_PARAM * | s_temp | ||
) |
int _mi_check_index | ( | MI_INFO * | info, |
int | inx | ||
) |
int _mi_ck_real_write_btree | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | key, | ||
uint | key_length, | ||
my_off_t * | root, | ||
uint | comp_flag | ||
) |
int _mi_cmp_dynamic_unique | ( | MI_INFO * | info, |
MI_UNIQUEDEF * | def, | ||
const uchar * | record, | ||
my_off_t | pos | ||
) |
int _mi_cmp_static_unique | ( | MI_INFO * | info, |
MI_UNIQUEDEF * | def, | ||
const uchar * | record, | ||
my_off_t | pos | ||
) |
int _mi_decrement_open_count | ( | MI_INFO * | info | ) |
int _mi_delete_dynamic_record | ( | MI_INFO * | info | ) |
int _mi_delete_static_record | ( | MI_INFO * | info | ) |
uchar * _mi_fetch_keypage | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
my_off_t | page, | ||
int | level, | ||
uchar * | buff, | ||
int | return_buffer | ||
) |
uchar * _mi_find_half_pos | ( | uint | nod_flag, |
MI_KEYDEF * | keyinfo, | ||
uchar * | page, | ||
uchar * | key, | ||
uint * | return_key_length, | ||
uchar ** | after_key | ||
) |
int _mi_ft_update | ( | MI_INFO * | info, |
uint | keynr, | ||
uchar * | keybuf, | ||
const uchar * | oldrec, | ||
const uchar * | newrec, | ||
my_off_t | pos | ||
) |
uint _mi_get_block_info | ( | MI_BLOCK_INFO * | info, |
File | file, | ||
my_off_t | filepos | ||
) |
uchar * _mi_get_key | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | page, | ||
uchar * | key, | ||
uchar * | keypos, | ||
uint * | return_key_length | ||
) |
uchar * _mi_get_last_key | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | keypos, | ||
uchar * | lastkey, | ||
uchar * | endpos, | ||
uint * | return_key_length | ||
) |
int _mi_insert | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | key, | ||
uchar * | anc_buff, | ||
uchar * | key_pos, | ||
uchar * | key_buff, | ||
uchar * | father_buff, | ||
uchar * | father_keypos, | ||
my_off_t | father_page, | ||
bool | insert_last | ||
) |
uint _mi_make_key | ( | MI_INFO * | info, |
uint | keynr, | ||
uchar * | key, | ||
const uchar * | record, | ||
my_off_t | filepos | ||
) |
int _mi_mark_file_changed | ( | MI_INFO * | info | ) |
bool _mi_memmap_file | ( | MI_INFO * | info | ) |
uint _mi_pack_get_block_info | ( | MI_INFO * | myisam, |
MI_BIT_BUFF * | bit_buff, | ||
MI_BLOCK_INFO * | info, | ||
uchar ** | rec_buff_p, | ||
File | file, | ||
my_off_t | filepos | ||
) |
uint _mi_pack_key | ( | MI_INFO * | info, |
uint | keynr, | ||
uchar * | key, | ||
const uchar * | old, | ||
key_part_map | keypart_map, | ||
HA_KEYSEG ** | last_used_keyseg | ||
) |
int _mi_pack_rec_unpack | ( | MI_INFO * | info, |
MI_BIT_BUFF * | bit_buff, | ||
uchar * | to, | ||
uchar * | from, | ||
ulong | reclength | ||
) |
int _mi_prefix_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 | ||
) |
int _mi_read_cache | ( | IO_CACHE * | info, |
uchar * | buff, | ||
my_off_t | pos, | ||
uint | length, | ||
int | re_read_if_possibly | ||
) |
bool _mi_read_pack_info | ( | MI_INFO * | info, |
bool | fix_keys | ||
) |
int _mi_read_rnd_dynamic_record | ( | MI_INFO * | info, |
uchar * | buf, | ||
my_off_t | filepos, | ||
bool | skip_deleted_blocks | ||
) |
int _mi_read_rnd_pack_record | ( | MI_INFO * | info, |
uchar * | buf, | ||
my_off_t | filepos, | ||
bool | skip_deleted_blocks | ||
) |
int _mi_read_rnd_static_record | ( | MI_INFO * | info, |
uchar * | buf, | ||
my_off_t | filepos, | ||
bool | skip_deleted_blocks | ||
) |
int _mi_readinfo | ( | MI_INFO * | info, |
int | lock_flag, | ||
int | check_keybuffer | ||
) |
bool _mi_rec_check | ( | MI_INFO * | info, |
const uchar * | record, | ||
uchar * | packpos, | ||
ulong | packed_length, | ||
bool | with_checkum | ||
) |
my_off_t _mi_rec_pos | ( | MYISAM_SHARE * | info, |
uchar * | ptr | ||
) |
void _mi_report_crashed | ( | MI_INFO * | file, |
const char * | message, | ||
const char * | sfile, | ||
uint | sline | ||
) |
Report list of threads (and queries) accessing a table, thread_id of a thread that detected corruption, ource file name and line number where this corruption was detected, optional extra information (string).
This function is intended to be used when table corruption is detected.
[in] | file | MI_INFO object. |
[in] | message | Optional error message. |
[in] | sfile | Name of source file. |
[in] | sline | Line number in source file. |
int _mi_search | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | key, | ||
uint | key_len, | ||
uint | nextflag, | ||
my_off_t | pos | ||
) |
int _mi_search_next | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | key, | ||
uint | key_length, | ||
uint | nextflag, | ||
my_off_t | pos | ||
) |
int _mi_seq_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 | ||
) |
int _mi_split_page | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
uchar * | key, | ||
uchar * | buff, | ||
uchar * | key_buff, | ||
bool | insert_last | ||
) |
void _mi_store_bin_pack_key | ( | MI_KEYDEF * | keyinfo, |
uchar * | key_pos, | ||
MI_KEY_PARAM * | s_temp | ||
) |
void _mi_store_blob_length | ( | uchar * | pos, |
uint | pack_length, | ||
uint | length | ||
) |
void _mi_store_static_key | ( | MI_KEYDEF * | keyinfo, |
uchar * | key_pos, | ||
MI_KEY_PARAM * | s_temp | ||
) |
void _mi_store_var_pack_key | ( | MI_KEYDEF * | keyinfo, |
uchar * | key_pos, | ||
MI_KEY_PARAM * | s_temp | ||
) |
int _mi_test_if_changed | ( | MI_INFO * | info | ) |
void _mi_unmap_file | ( | MI_INFO * | info | ) |
int _mi_write_keypage | ( | MI_INFO * | info, |
MI_KEYDEF * | keyinfo, | ||
my_off_t | page, | ||
int | level, | ||
uchar * | buff | ||
) |
int _mi_write_part_record | ( | MI_INFO * | info, |
my_off_t | filepos, | ||
ulong | length, | ||
my_off_t | next_filepos, | ||
uchar ** | record, | ||
ulong * | reclength, | ||
int * | flag | ||
) |
int _mi_writeinfo | ( | MI_INFO * | info, |
uint | options | ||
) |
void _myisam_log | ( | enum myisam_log_commands | command, |
MI_INFO * | info, | ||
const uchar * | buffert, | ||
uint | length | ||
) |
void _myisam_log_command | ( | enum myisam_log_commands | command, |
MI_INFO * | info, | ||
const uchar * | buffert, | ||
uint | length, | ||
int | result | ||
) |
void _myisam_log_record | ( | enum myisam_log_commands | command, |
MI_INFO * | info, | ||
const uchar * | record, | ||
my_off_t | filepos, | ||
int | result | ||
) |
uint calc_pack_length | ( | uint | version, |
ulong | length | ||
) |
bool check_table_is_closed | ( | const char * | name, |
const char * | where | ||
) |
int flush_pending_blocks | ( | MI_SORT_PARAM * | param | ) |
void init_myisam_psi_keys | ( | ) |
volatile int * killed_ptr | ( | MI_CHECK * | param | ) |
uint mi_base_info_write | ( | File | file, |
MI_BASE_INFO * | base | ||
) |
void mi_check_print_error | ( | MI_CHECK * | param, |
const char * | fmt, | ||
... | |||
) |
void mi_check_print_info | ( | MI_CHECK * | param, |
const char * | fmt, | ||
... | |||
) |
void mi_check_print_warning | ( | MI_CHECK * | param, |
const char * | fmt, | ||
... | |||
) |
bool mi_check_status | ( | void * | param | ) |
bool mi_check_unique | ( | MI_INFO * | info, |
MI_UNIQUEDEF * | def, | ||
uchar * | record, | ||
ha_checksum | unique_hash, | ||
my_off_t | pos | ||
) |
ha_checksum mi_checksum | ( | MI_INFO * | info, |
const uchar * | buf | ||
) |
void mi_copy_status | ( | void * | to, |
void * | from | ||
) |
int mi_disable_indexes | ( | MI_INFO * | info | ) |
int mi_enable_indexes | ( | MI_INFO * | info | ) |
void mi_get_status | ( | void * | param, |
int | concurrent_insert | ||
) |
int mi_indexes_are_disabled | ( | MI_INFO * | info | ) |
size_t mi_mmap_pwrite | ( | MI_INFO * | info, |
const uchar * | Buffer, | ||
size_t | Count, | ||
my_off_t | offset, | ||
myf | MyFlags | ||
) |
int mi_munmap_file | ( | MI_INFO * | info | ) |
size_t mi_nommap_pread | ( | MI_INFO * | info, |
uchar * | Buffer, | ||
size_t | Count, | ||
my_off_t | offset, | ||
myf | MyFlags | ||
) |
size_t mi_nommap_pwrite | ( | MI_INFO * | info, |
const uchar * | Buffer, | ||
size_t | Count, | ||
my_off_t | offset, | ||
myf | MyFlags | ||
) |
int mi_open_datafile | ( | MI_INFO * | info, |
MYISAM_SHARE * | share, | ||
const char * | orn_name, | ||
File | file_to_dup | ||
) |
int mi_open_keyfile | ( | MYISAM_SHARE * | share | ) |
uchar * mi_recinfo_read | ( | uchar * | ptr, |
MI_COLUMNDEF * | recinfo | ||
) |
uint mi_recinfo_write | ( | File | file, |
MI_COLUMNDEF * | recinfo | ||
) |
void mi_report_error | ( | int | errcode, |
const char * | file_name | ||
) |
void mi_restore_status | ( | void * | param | ) |
void mi_set_index_cond_func | ( | MI_INFO * | info, |
index_cond_func_t | func, | ||
void * | func_arg | ||
) |
void mi_setup_functions | ( | MYISAM_SHARE * | share | ) |
uchar * mi_state_info_read | ( | uchar * | ptr, |
MI_STATE_INFO * | state | ||
) |
uint mi_state_info_read_dsk | ( | File | file, |
MI_STATE_INFO * | state, | ||
bool | pRead | ||
) |
uint mi_state_info_write | ( | File | file, |
MI_STATE_INFO * | state, | ||
uint | pWrite | ||
) |
ha_checksum mi_static_checksum | ( | MI_INFO * | info, |
const uchar * | buf | ||
) |
int mi_unique_comp | ( | MI_UNIQUEDEF * | def, |
const uchar * | a, | ||
const uchar * | b, | ||
bool | null_are_equal | ||
) |
ha_checksum mi_unique_hash | ( | MI_UNIQUEDEF * | def, |
const uchar * | buf | ||
) |
uchar * mi_uniquedef_read | ( | uchar * | ptr, |
MI_UNIQUEDEF * | keydef | ||
) |
uint mi_uniquedef_write | ( | File | file, |
MI_UNIQUEDEF * | keydef | ||
) |
void mi_update_status | ( | void * | param | ) |
uchar * my_n_base_info_read | ( | uchar * | ptr, |
MI_BASE_INFO * | base | ||
) |
uint read_pack_length | ( | uint | version, |
const uchar * | buf, | ||
ulong * | length | ||
) |
uint save_pack_length | ( | uint | version, |
uchar * | block_buff, | ||
ulong | length | ||
) |
int sort_ft_buf_flush | ( | MI_SORT_PARAM * | sort_param | ) |
int sort_write_record | ( | MI_SORT_PARAM * | sort_param | ) |
MI_INFO * test_if_reopen | ( | char * | filename | ) |
|
extern |
|
extern |
|
extern |
|
extern |
PSI_file_key mi_key_file_dfile |
PSI_file_key mi_key_file_kfile |
PSI_file_key mi_key_file_log |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_mmap_lock |
|
extern |
PSI_cond_key mi_keycache_thread_var_suspend |
|
extern |
|
extern |
|
extern |
uchar myisam_pack_file_magic[] |
|
extern |
|
extern |
|
extern |
uint myisam_readnext_vec[] |
|
extern |