Commit 961fc6a6 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: T_REP/T_REP_BY_SORT/T_REP_PARALLEL in MyISAM

always set them according to the repair method used
parent b634bd50
...@@ -1031,9 +1031,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) ...@@ -1031,9 +1031,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
continue; continue;
} }
param.testflag&= ~T_QUICK; param.testflag&= ~T_QUICK;
if ((param.testflag & T_REP_BY_SORT)) if ((param.testflag & (T_REP_BY_SORT | T_REP_PARALLEL)))
{ {
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP; param.testflag= (param.testflag & ~T_REP_ANY) | T_REP;
sql_print_information("Retrying repair of: '%s' with keycache", sql_print_information("Retrying repair of: '%s' with keycache",
table->s->path.str); table->s->path.str);
continue; continue;
......
...@@ -2207,7 +2207,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info, ...@@ -2207,7 +2207,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
printf("- recovering (with sort) MyISAM-table '%s'\n",name); printf("- recovering (with sort) MyISAM-table '%s'\n",name);
printf("Data records: %s\n", llstr(start_records,llbuff)); printf("Data records: %s\n", llstr(start_records,llbuff));
} }
param->testflag|=T_REP; /* for easy checking */ param->testflag|=T_REP_BY_SORT; /* for easy checking */
param->retry_repair= 0; param->retry_repair= 0;
param->warning_printed= param->error_printed= param->note_printed= 0; param->warning_printed= param->error_printed= param->note_printed= 0;
...@@ -2637,7 +2637,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, ...@@ -2637,7 +2637,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
printf("- parallel recovering (with sort) MyISAM-table '%s'\n",name); printf("- parallel recovering (with sort) MyISAM-table '%s'\n",name);
printf("Data records: %s\n", llstr(start_records,llbuff)); printf("Data records: %s\n", llstr(start_records,llbuff));
} }
param->testflag|=T_REP; /* for easy checking */ param->testflag|=T_REP_PARALLEL; /* for easy checking */
param->retry_repair= 0; param->retry_repair= 0;
param->warning_printed= 0; param->warning_printed= 0;
param->error_printed= 0; param->error_printed= 0;
...@@ -3555,7 +3555,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) ...@@ -3555,7 +3555,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
if (sort_param->calc_checksum) if (sort_param->calc_checksum)
info->checksum= (*info->s->calc_check_checksum)(info, info->checksum= (*info->s->calc_check_checksum)(info,
sort_param->record); sort_param->record);
if ((param->testflag & (T_EXTEND | T_REP)) || searching) if ((param->testflag & (T_EXTEND | T_REP_ANY)) || searching)
{ {
if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff, if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff,
sort_param->find_length, sort_param->find_length,
...@@ -4509,7 +4509,7 @@ void update_auto_increment_key(HA_CHECK *param, MI_INFO *info, ...@@ -4509,7 +4509,7 @@ void update_auto_increment_key(HA_CHECK *param, MI_INFO *info,
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
if (!(param->testflag & T_SILENT) && if (!(param->testflag & T_SILENT) &&
!(param->testflag & T_REP)) !(param->testflag & T_REP_ANY))
printf("Updating MyISAM file: %s\n", param->isam_file_name); printf("Updating MyISAM file: %s\n", param->isam_file_name);
/* /*
We have to use an allocated buffer instead of info->rec_buff as We have to use an allocated buffer instead of info->rec_buff as
......
...@@ -94,11 +94,10 @@ int main(int argc, char **argv) ...@@ -94,11 +94,10 @@ int main(int argc, char **argv)
(void) fflush(stderr); (void) fflush(stderr);
if ((check_param.error_printed | check_param.warning_printed) && if ((check_param.error_printed | check_param.warning_printed) &&
(check_param.testflag & T_FORCE_CREATE) && (check_param.testflag & T_FORCE_CREATE) &&
(!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS | (!(check_param.testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))))
T_SORT_INDEX))))
{ {
ulonglong old_testflag=check_param.testflag; ulonglong old_testflag=check_param.testflag;
if (!(check_param.testflag & T_REP)) if (!(check_param.testflag & T_REP_ANY))
check_param.testflag|= T_REP_BY_SORT; check_param.testflag|= T_REP_BY_SORT;
check_param.testflag&= ~T_EXTEND; /* Don't needed */ check_param.testflag&= ~T_EXTEND; /* Don't needed */
error|=myisamchk(&check_param, argv[-1]); error|=myisamchk(&check_param, argv[-1]);
...@@ -1067,7 +1066,7 @@ static int myisamchk(HA_CHECK *param, char * filename) ...@@ -1067,7 +1066,7 @@ static int myisamchk(HA_CHECK *param, char * filename)
error=mi_sort_records(param,info,filename,param->opt_sort_key, error=mi_sort_records(param,info,filename,param->opt_sort_key,
/* what is the following parameter for ? */ /* what is the following parameter for ? */
(my_bool) !(param->testflag & T_REP), (my_bool) !(param->testflag & T_REP_ANY),
update_index); update_index);
datafile=info->dfile; /* This is now locked */ datafile=info->dfile; /* This is now locked */
if (!error && !update_index) if (!error && !update_index)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment