summaryrefslogtreecommitdiff
path: root/myisam/mi_check.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-06-04 21:15:08 +0200
committerunknown <serg@serg.mylan>2004-06-04 21:15:08 +0200
commit889058aa00548af6db093b8e0c3503cadb6334ea (patch)
tree409807ee56e74592e230fe8d430133d18fb728c5 /myisam/mi_check.c
parent39c7065faeb934df3bdd6b4e91a644c7ae12ad1c (diff)
downloadmariadb-git-889058aa00548af6db093b8e0c3503cadb6334ea.tar.gz
make CHECK killable
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r--myisam/mi_check.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 5f20046d1cf..212b656eb20 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -142,6 +142,8 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
empty=0;
for (i= info->state->del ; i > 0L && next_link != HA_OFFSET_ERROR ; i--)
{
+ if (*killed_ptr(param))
+ DBUG_RETURN(1);
if (test_flag & T_VERBOSE)
printf(" %9s",llstr(next_link,buff));
if (next_link >= info->state->data_file_length)
@@ -233,6 +235,8 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
records= (ha_rows) (info->state->key_file_length / block_size);
while (next_link != HA_OFFSET_ERROR && records > 0)
{
+ if (*killed_ptr(param))
+ DBUG_RETURN(1);
if (param->testflag & T_VERBOSE)
printf("%16s",llstr(next_link,llbuff));
if (next_link > info->state->key_file_length ||
@@ -372,6 +376,8 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ;
rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++)
{
+ if (*killed_ptr(param))
+ DBUG_RETURN(-1);
param->key_crc[key]=0;
if (!(((ulonglong) 1 << key) & share->state.key_map))
{
@@ -592,6 +598,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
for ( ;; )
{
+ if (*killed_ptr(param))
+ goto err;
memcpy((char*) info->lastkey,(char*) key,key_length);
info->lastkey_length=key_length;
if (nod_flag)
@@ -782,6 +790,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
while (pos < info->state->data_file_length)
{
+ if (*killed_ptr(param))
+ goto err2;
switch (info->s->data_file_type) {
case STATIC_RECORD:
if (my_b_read(&param->read_cache,(byte*) record,