summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-07-13 16:51:10 +0200
committerunknown <guilhem@mysql.com>2004-07-13 16:51:10 +0200
commit6221e0decc023eaa0bd8602905d4e0addfb5fbce (patch)
tree47faff62294fc5946fdc4c66c30c9f75116415bb /sql/ha_myisam.cc
parent80e005737b921624a7cf9d6dbdea6597897341e1 (diff)
downloadmariadb-git-6221e0decc023eaa0bd8602905d4e0addfb5fbce.tar.gz
WL#1900 "When CHECK TABLE or ANALYZE TABLE of a MyISAM table is killed
by KILL or shutdown, do not mark the table as corrupted". It is indeed more logical to leave the corruption flag unchanged. This cannot be extended to REPAIR/OPTIMIZE as they make no backup copy of the MYI. This patch was tested with KILL and mysqladmin shutdown while a CHECK TABLE was running. Without the patch, the table becomes unusable (can't INSERT to it, error 145). With the patch, no. sql/ha_myisam.cc: When CHECK TABLE or ANALYZE TABLE is killed by KILL, do not mark the table corrupted; leave its corruption flag unchanged.
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 77615d68fe4..51c8521c376 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -336,7 +336,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
HA_STATUS_CONST);
}
}
- else if (!mi_is_crashed(file))
+ else if (!mi_is_crashed(file) && !thd->killed)
{
mi_mark_crashed(file);
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
@@ -378,7 +378,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
error=update_state_info(&param,file,UPDATE_STAT);
pthread_mutex_unlock(&share->intern_lock);
}
- else if (!mi_is_crashed(file))
+ else if (!mi_is_crashed(file) && !thd->killed)
mi_mark_crashed(file);
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
}