summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2004-10-14 20:04:47 +0200
committerunknown <ingo@mysql.com>2004-10-14 20:04:47 +0200
commitc461eb866e45a2c3f38e3ab01a36781c1ab9d174 (patch)
treed05ab26e45e759e008bac5248cde0bf06d08ec72
parenteb3b0480002d257d9beb5262fd51619cc4b50a1f (diff)
parentfc27da0879c477eba748d1412978afa4032b54ab (diff)
downloadmariadb-git-c461eb866e45a2c3f38e3ab01a36781c1ab9d174.tar.gz
Merge mysql.com:/home/mydev/mysql-4.0
into mysql.com:/home/mydev/mysql-4.0-bug5625 sql/ha_myisam.cc: Auto merged sql/sql_table.cc: Auto merged
-rw-r--r--sql/ha_myisam.cc18
-rw-r--r--sql/sql_table.cc2
2 files changed, 17 insertions, 3 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 3bfee7cdd79..d79ea4adda0 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -525,6 +525,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
{
+ int error;
if (!file) return HA_ADMIN_INTERNAL_ERROR;
MI_CHECK param;
@@ -534,7 +535,14 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
param.testflag = (check_opt->flags | T_SILENT | T_FORCE_CREATE |
T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX);
param.sort_buffer_length= check_opt->sort_buffer_size;
- return repair(thd,param,1);
+ if ((error= repair(thd,param,1)) && param.retry_repair)
+ {
+ sql_print_warning("Warning: Optimize table got errno %d, retrying",
+ my_errno);
+ param.testflag&= ~T_REP_BY_SORT;
+ error= repair(thd,param,1);
+ }
+ return error;
}
@@ -744,7 +752,13 @@ bool ha_myisam::activate_all_index(THD *thd)
param.myf_rw&= ~MY_WAIT_IF_FULL;
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
param.tmpdir=mysql_tmpdir;
- error=repair(thd,param,0) != HA_ADMIN_OK;
+ if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
+ {
+ sql_print_warning("Warning: Enabling keys got errno %d, retrying",
+ my_errno);
+ param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
+ error= (repair(thd,param,0) != HA_ADMIN_OK);
+ }
info(HA_STATUS_CONST);
thd->proc_info=save_proc_info;
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 520cce23797..8190e31bc0b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1614,7 +1614,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
- error= table->file->activate_all_index(thd);
+ error= (table->file->activate_all_index(thd) ? -1 : 0);
/* COND_refresh will be signaled in close_thread_tables() */
break;
case DISABLE: