MySQL 9.1.0
Source Code Documentation
myisamchk.cc File Reference
#include "my_config.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <bit>
#include "m_string.h"
#include "my_byteorder.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_default.h"
#include "my_getopt.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_systime.h"
#include "mysql/strings/int2str.h"
#include "mysql/strings/m_ctype.h"
#include "nulls.h"
#include "print_version.h"
#include "storage/myisam/fulltext.h"
#include "storage/myisam/myisam_sys.h"
#include "storage/myisam/myisamdef.h"
#include "typelib.h"
#include "welcome_copyright_notice.h"
#include <sys/mman.h>
#include "storage/myisam/mi_extrafunc.h"

Enumerations

enum  options_mc {
  OPT_CHARSETS_DIR = 256 , OPT_SET_COLLATION , OPT_START_CHECK_POS , OPT_CORRECT_CHECKSUM ,
  OPT_KEY_BUFFER_SIZE , OPT_KEY_CACHE_BLOCK_SIZE , OPT_MYISAM_BLOCK_SIZE , OPT_READ_BUFFER_SIZE ,
  OPT_WRITE_BUFFER_SIZE , OPT_SORT_BUFFER_SIZE , OPT_SORT_KEY_BLOCKS , OPT_DECODE_BITS ,
  OPT_FT_MIN_WORD_LEN , OPT_FT_MAX_WORD_LEN , OPT_FT_STOPWORD_FILE , OPT_MAX_RECORD_LENGTH ,
  OPT_STATS_METHOD
}
 

Functions

static void get_options (int *argc, char ***argv, MEM_ROOT *alloc)
 
static void usage (void)
 
static int myisamchk (MI_CHECK *param, char *filename)
 
static void descript (MI_CHECK *param, MI_INFO *info, char *name)
 
static int mi_sort_records (MI_CHECK *param, MI_INFO *info, char *name, uint sort_key, bool write_info, bool update_index)
 
static int sort_record_index (MI_SORT_PARAM *sort_param, MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, uchar *buff, uint sortkey, File new_file, bool update_index)
 
st_keycache_thread_varkeycache_thread_var ()
 
int main (int argc, char **argv)
 
static bool get_one_option (int optid, const struct my_option *opt, char *argument)
 
volatile int * killed_ptr (MI_CHECK *param)
 
void mi_check_print_info (MI_CHECK *param, const char *fmt,...)
 
void mi_check_print_warning (MI_CHECK *param, const char *fmt,...)
 
void mi_check_print_error (MI_CHECK *param, const char *fmt,...)
 

Variables

static uint decode_bits
 
static const char * load_default_groups [] = {"myisamchk", nullptr}
 
static const char * set_collation_name
 
static const char * opt_tmpdir
 
static CHARSET_INFOset_collation
 
static long opt_myisam_block_size
 
static long opt_key_cache_block_size
 
static const char * my_progname_short
 
static int stopwords_inited = 0
 
static MY_TMPDIR myisamchk_tmpdir
 
static const char * type_names []
 
static const char * prefix_packed_txt = "packed "
 
static const char * bin_packed_txt = "prefix "
 
static const char * diff_txt = "stripped "
 
static const char * null_txt = "NULL"
 
static const char * blob_txt = "BLOB "
 
static const char * field_pack []
 
static const char * myisam_stats_method_str = "nulls_unequal"
 
MI_CHECK check_param
 
static struct my_option my_long_options []
 
const char * myisam_stats_method_names []
 
TYPELIB myisam_stats_method_typelib
 
static int not_killed = 0
 

Enumeration Type Documentation

◆ options_mc

enum options_mc
Enumerator
OPT_CHARSETS_DIR 
OPT_SET_COLLATION 
OPT_START_CHECK_POS 
OPT_CORRECT_CHECKSUM 
OPT_KEY_BUFFER_SIZE 
OPT_KEY_CACHE_BLOCK_SIZE 
OPT_MYISAM_BLOCK_SIZE 
OPT_READ_BUFFER_SIZE 
OPT_WRITE_BUFFER_SIZE 
OPT_SORT_BUFFER_SIZE 
OPT_SORT_KEY_BLOCKS 
OPT_DECODE_BITS 
OPT_FT_MIN_WORD_LEN 
OPT_FT_MAX_WORD_LEN 
OPT_FT_STOPWORD_FILE 
OPT_MAX_RECORD_LENGTH 
OPT_STATS_METHOD 

Function Documentation

◆ descript()

static void descript ( MI_CHECK param,
MI_INFO info,
char *  name 
)
static

◆ get_one_option()

static bool get_one_option ( int  optid,
const struct my_option opt,
char *  argument 
)
static

◆ get_options()

static void get_options ( int *  argc,
char ***  argv,
MEM_ROOT alloc 
)
static

◆ keycache_thread_var()

st_keycache_thread_var * keycache_thread_var ( )

◆ killed_ptr()

volatile int * killed_ptr ( MI_CHECK param)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ mi_check_print_error()

void mi_check_print_error ( MI_CHECK param,
const char *  fmt,
  ... 
)

◆ mi_check_print_info()

void mi_check_print_info ( MI_CHECK param,
const char *  fmt,
  ... 
)

◆ mi_check_print_warning()

void mi_check_print_warning ( MI_CHECK param,
const char *  fmt,
  ... 
)

◆ mi_sort_records()

static int mi_sort_records ( MI_CHECK param,
MI_INFO info,
char *  name,
uint  sort_key,
bool  write_info,
bool  update_index 
)
static

◆ myisamchk()

static int myisamchk ( MI_CHECK param,
char *  filename 
)
static

◆ sort_record_index()

static int sort_record_index ( MI_SORT_PARAM sort_param,
MI_INFO info,
MI_KEYDEF keyinfo,
my_off_t  page,
uchar buff,
uint  sortkey,
File  new_file,
bool  update_index 
)
static

◆ usage()

static void usage ( void  )
static

Variable Documentation

◆ bin_packed_txt

const char * bin_packed_txt = "prefix "
static

◆ blob_txt

const char * blob_txt = "BLOB "
static

◆ check_param

MI_CHECK check_param

◆ decode_bits

uint decode_bits
static

◆ diff_txt

const char * diff_txt = "stripped "
static

◆ field_pack

const char* field_pack[]
static
Initial value:
= {"",
"no endspace",
"no prespace",
"no zeros",
"blob",
"constant",
"table-lockup",
"always zero",
"varchar",
"unique-hash",
"?",
"?"}

◆ load_default_groups

const char* load_default_groups[] = {"myisamchk", nullptr}
static

◆ my_long_options

struct my_option my_long_options[]
static

◆ my_progname_short

const char* my_progname_short
static

◆ myisam_stats_method_names

const char* myisam_stats_method_names[]
Initial value:
= {"nulls_unequal", "nulls_equal",
"nulls_ignored", NullS}
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: nulls.h:33

◆ myisam_stats_method_str

const char* myisam_stats_method_str = "nulls_unequal"
static

◆ myisam_stats_method_typelib

TYPELIB myisam_stats_method_typelib
Initial value:
= {
const char * myisam_stats_method_names[]
Definition: myisamchk.cc:517
#define array_elements(A)
Definition: validate_password_imp.cc:50

◆ myisamchk_tmpdir

MY_TMPDIR myisamchk_tmpdir
static

◆ not_killed

int not_killed = 0
static

◆ null_txt

const char * null_txt = "NULL"
static

◆ opt_key_cache_block_size

long opt_key_cache_block_size
static

◆ opt_myisam_block_size

long opt_myisam_block_size
static

◆ opt_tmpdir

const char * opt_tmpdir
static

◆ prefix_packed_txt

const char* prefix_packed_txt = "packed "
static

◆ set_collation

CHARSET_INFO* set_collation
static

◆ set_collation_name

const char* set_collation_name
static

◆ stopwords_inited

int stopwords_inited = 0
static

◆ type_names

const char* type_names[]
static
Initial value:
= {"impossible",
"char",
"binary",
"short",
"long",
"float",
"double",
"number",
"unsigned short",
"unsigned long",
"longlong",
"ulonglong",
"int24",
"uint24",
"int8",
"varchar",
"varbin",
"?",
"?"}