summaryrefslogtreecommitdiff
path: root/myisam/myisamchk.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r--myisam/myisamchk.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index cff5f781538..e5ea58148e3 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -183,7 +183,6 @@ static struct option long_options[] =
{"information", no_argument, 0, 'i'},
{"keys-used", required_argument, 0, 'k'},
{"medium-check", no_argument, 0, 'm'},
- {"no-symlinks", no_argument, 0, 'l'},
{"quick", no_argument, 0, 'q'},
{"read-only", no_argument, 0, 'T'},
{"recover", no_argument, 0, 'r'},
@@ -207,7 +206,7 @@ static struct option long_options[] =
static void print_version(void)
{
- printf("%s Ver 1.45 for %s at %s\n",my_progname,SYSTEM_TYPE,
+ printf("%s Ver 1.47 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
}
@@ -240,7 +239,8 @@ static void usage(void)
-F, --fast Check only tables that hasn't been closed properly\n\
-C, --check-only-changed\n\
Check only tables that has changed since last check\n\
- -f, --force Restart with -r if there are any errors in the table\n\
+ -f, --force Restart with -r if there are any errors in the table.\n\
+ States will be updated as with --update-state\n\
-i, --information Print statistics information about table that is checked\n\
-m, --medium-check Faster than extended-check, but only finds 99.99% of\n\
all errors. Should be good enough for most cases\n\
@@ -365,7 +365,7 @@ static void get_options(register int *argc,register char ***argv)
break;
case 'f':
check_param.tmpfile_createflag= O_RDWR | O_TRUNC;
- check_param.testflag|=T_FORCE_CREATE;
+ check_param.testflag|= T_FORCE_CREATE | T_UPDATE_STATE;
break;
case 'F':
check_param.testflag|=T_FAST;
@@ -373,9 +373,6 @@ static void get_options(register int *argc,register char ***argv)
case 'k':
check_param.keys_in_use= (ulonglong) strtoll(optarg,NULL,10);
break;
- case 'l':
- check_param.opt_follow_links=0;
- break;
case 'm':
check_param.testflag|= T_MEDIUM; /* Medium check */
break;
@@ -498,7 +495,6 @@ static int myisamchk(MI_CHECK *param, my_string filename)
uint raid_chunks;
MI_INFO *info;
File datafile;
- char fixed_name[FN_REFLEN];
char llbuff[22],llbuff2[22];
my_bool state_updated=0;
MYISAM_SHARE *share;
@@ -675,9 +671,6 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (tmp != share->state.key_map)
info->update|=HA_STATE_CHANGED;
}
- VOID(fn_format(fixed_name,filename,"",MI_NAME_IEXT,
- 4+ (param->opt_follow_links ? 16 : 0)));
-
if (rep_quick && chk_del(&check_param, info,
param->testflag & ~T_VERBOSE))
{
@@ -702,11 +695,11 @@ static int myisamchk(MI_CHECK *param, my_string filename)
info->s->state.key_map,
check_param.force_sort))
{
- error=mi_repair_by_sort(&check_param,info,fixed_name,rep_quick);
+ error=mi_repair_by_sort(&check_param,info,filename,rep_quick);
state_updated=1;
}
else if (param->testflag & (T_REP | T_REP_BY_SORT))
- error=mi_repair(&check_param, info,fixed_name,rep_quick);
+ error=mi_repair(&check_param, info,filename,rep_quick);
}
if (!error && param->testflag & T_SORT_RECORDS)
{
@@ -718,7 +711,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (param->out_flag & O_NEW_DATA)
{ /* Change temp file to org file */
VOID(my_close(info->dfile,MYF(MY_WME))); /* Close new file */
- error|=change_to_newfile(fixed_name,MI_NAME_DEXT,DATA_TMP_EXT,
+ error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
MYF(0));
if (mi_open_datafile(info,info->s))
@@ -739,7 +732,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (share->keyinfo[key].flag & HA_BINARY_PACK_KEY)
update_index=0;
- error=mi_sort_records(param,info,fixed_name,param->opt_sort_key,
+ error=mi_sort_records(param,info,filename,param->opt_sort_key,
(my_bool) !(param->testflag & T_REP),
update_index);
datafile=info->dfile; /* This is now locked */
@@ -747,12 +740,12 @@ static int myisamchk(MI_CHECK *param, my_string filename)
{
if (check_param.verbose)
puts("Table had a compressed index; We must now recreate the index");
- error=mi_repair_by_sort(&check_param,info,fixed_name,1);
+ error=mi_repair_by_sort(&check_param,info,filename,1);
}
}
}
if (!error && param->testflag & T_SORT_INDEX)
- error=mi_sort_index(param,info,fixed_name);
+ error=mi_sort_index(param,info,filename);
if (!error)
share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED |
STATE_CRASHED_ON_REPAIR);
@@ -849,12 +842,12 @@ end2:
if (error == 0)
{
if (param->out_flag & O_NEW_DATA)
- error|=change_to_newfile(fixed_name,MI_NAME_DEXT,DATA_TMP_EXT,
+ error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
if (param->out_flag & O_NEW_INDEX)
- error|=change_to_newfile(fixed_name,MI_NAME_IEXT,INDEX_TMP_EXT,0,
+ error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0,
MYF(0));
}
VOID(fflush(stdout)); VOID(fflush(stderr));
@@ -1212,7 +1205,9 @@ static int mi_sort_records(MI_CHECK *param,
mi_check_print_error(param,"Not enough memory for record");
goto err;
}
- new_file=my_raid_create(fn_format(param->temp_filename,name,"",
+ fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
+ new_file=my_raid_create(fn_format(param->temp_filename,
+ param->temp_filename,"",
DATA_TMP_EXT,2+4),
0,param->tmpfile_createflag,
share->base.raid_type,