summaryrefslogtreecommitdiff
path: root/myisam/myisamchk.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r--myisam/myisamchk.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index ac1d0fbfc4a..104b344a9e2 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,9 +41,10 @@ SET_STACK_SIZE(9000) /* Minimum stack size for program */
static uint decode_bits;
static char **default_argv;
static const char *load_default_groups[]= { "myisamchk", 0 };
-static const char *set_charset_name;
+static const char *set_charset_name, *opt_tmpdir;
static CHARSET_INFO *set_charset;
static long opt_myisam_block_size;
+static MY_TMPDIR myisamchk_tmpdir;
static const char *type_names[]=
{ "?","char","binary", "short", "long", "float",
@@ -133,6 +134,7 @@ int main(int argc, char **argv)
llstr(check_param.total_deleted,buff2));
}
free_defaults(default_argv);
+ free_tmpdir(&myisamchk_tmpdir);
ft_free_stopwords();
my_end(check_param.testflag & T_INFO ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
exit(error);
@@ -257,7 +259,7 @@ static struct my_option my_long_options[] =
0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files.",
- (gptr*) &check_param.tmpdir,
+ (gptr*) &opt_tmpdir,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"update-state", 'U',
"Mark tables as crashed if any errors were found.",
@@ -338,7 +340,15 @@ static void usage(void)
Change the value of a variable. Please note that\n\
this option is deprecated; you can set variables\n\
directly with '--variable-name=value'.\n\
- -t, --tmpdir=path Path for temporary files\n\
+ -t, --tmpdir=path Path for temporary files. Multiple paths can be\n\
+ specified, separated by "
+#if defined( __WIN__) || defined(OS2)
+ "semicolon (;)"
+#else
+ "colon (:)"
+#endif
+ ", they will be used\n\
+ in a round-robin fashion.\n\
-s, --silent Only print errors. One can use two -s to make\n\
myisamchk very silent\n\
-v, --verbose Print more information. This can be used with\n\
@@ -693,6 +703,11 @@ static void get_options(register int *argc,register char ***argv)
exit(1);
}
+ if (init_tmpdir(&myisamchk_tmpdir, opt_tmpdir))
+ exit(1);
+
+ check_param.tmpdir=&myisamchk_tmpdir;
+
if (set_charset_name)
if (!(set_charset=get_charset_by_name(set_charset_name, MYF(MY_WME))))
exit(1);
@@ -859,7 +874,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
}
else
{
- if (share->fulltext_index)
+ if (share->state.header.fulltext_keys)
ft_init_stopwords();
if (!(param->testflag & T_READONLY))
@@ -1107,7 +1122,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
{
uint key,keyseg_nr,field,start;
reg3 MI_KEYDEF *keyinfo;
- reg2 MI_KEYSEG *keyseg;
+ reg2 HA_KEYSEG *keyseg;
reg4 const char *text;
char buff[160],length[10],*pos,*end;
enum en_fieldtype type;
@@ -1629,6 +1644,10 @@ err:
DBUG_RETURN(1);
} /* sort_record_index */
+volatile bool *killed_ptr(MI_CHECK *param)
+{
+ return (bool *)(& param->thd); /* always NULL */
+}
/* print warnings and errors */
/* VARARGS */