summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 70137ff2b16..ced00c94e73 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -985,11 +985,16 @@ int ha_myisam::enable_indexes(uint mode)
{
sql_print_warning("Warning: Enabling keys got errno %d, retrying",
my_errno);
- thd->clear_error();
+ /* Repairing by sort failed. Now try standard repair method. */
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
error= (repair(thd,param,0) != HA_ADMIN_OK);
- if (!error && thd->net.report_error)
- error= HA_ERR_CRASHED;
+ /*
+ If the standard repair succeeded, clear all error messages which
+ might have been set by the first repair. They can still be seen
+ with SHOW WARNINGS then.
+ */
+ if (! error)
+ thd->clear_error();
}
info(HA_STATUS_CONST);
thd->proc_info=save_proc_info;