summaryrefslogtreecommitdiff
path: root/myisam/mi_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r--myisam/mi_check.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index f9e943fe42c..02bca2911b4 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -112,20 +112,13 @@ int chk_status(MI_CHECK *param, register MI_INFO *info)
int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
{
reg2 ha_rows i;
- uint j,delete_link_length;
+ uint delete_link_length;
my_off_t empty,next_link,old_link;
char buff[22],buff2[22];
DBUG_ENTER("chk_del");
- if (!(test_flag & T_SILENT))
- puts("- check key delete-chain");
-
LINT_INIT(old_link);
param->record_checksum=0;
- param->key_file_blocks=info->s->base.keystart;
- for (j=0 ; j < info->s->state.header.max_block_size ; j++)
- if (check_k_link(param,info,j))
- goto wrong;
delete_link_length=((info->s->options & HA_OPTION_PACK_RECORD) ? 20 :
info->s->rec_reflength+1);
@@ -352,6 +345,18 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
char buff[22],buff2[22];
DBUG_ENTER("chk_key");
+ if (!(param->testflag & T_SILENT))
+ puts("- check key delete-chain");
+
+ param->key_file_blocks=info->s->base.keystart;
+ for (key=0 ; key < info->s->state.header.max_block_size ; key++)
+ if (check_k_link(param,info,key))
+ {
+ if (param->testflag & T_VERBOSE) puts("");
+ mi_check_print_error(param,"key delete-link-chain corrupted");
+ DBUG_RETURN(-1);
+ }
+
if (!(param->testflag & T_SILENT)) puts("- check index reference");
all_keydata=all_totaldata=key_totlength=0;
@@ -1208,9 +1213,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename,
- param->temp_filename,"",
+ share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0,param->tmpfile_createflag,
share->base.raid_type,
@@ -1882,11 +1886,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename,
- param->temp_filename, "",
- DATA_TMP_EXT,
- 2+4),
+ share->data_file_name, "",
+ DATA_TMP_EXT, 2+4),
0,param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
@@ -2248,9 +2250,8 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename,
- param->temp_filename, "",
+ share->data_file_name, "",
DATA_TMP_EXT,
2+4),
0,param->tmpfile_createflag,