summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorunknown <istruewing@blade08.mysql.com>2007-03-16 12:26:36 +0100
committerunknown <istruewing@blade08.mysql.com>2007-03-16 12:26:36 +0100
commit25101100c5c3a08605fde71356d453f95da7b273 (patch)
tree1000f3ff3f5affaa0f8877c7e3bc3b943edb2289 /sql/ha_myisam.cc
parent6f47415f0e9595f9ba07cd04d93d9f3290a20501 (diff)
parentc7ce63fb0ba339ffa15a36515831660225a49e53 (diff)
downloadmariadb-git-25101100c5c3a08605fde71356d453f95da7b273.tar.gz
Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into blade08.mysql.com:/data0/istruewing/autopush/mysql-5.0-bug25289 sql/ha_myisam.cc: Auto merged
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 10d3dbb2ec5..6d8a770175d 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -976,6 +976,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
ha_rows rows= file->state->records;
DBUG_ENTER("ha_myisam::repair");
+ /*
+ Normally this method is entered with a properly opened table. If the
+ repair fails, it can be repeated with more elaborate options. Under
+ special circumstances it can happen that a repair fails so that it
+ closed the data file and cannot re-open it. In this case file->dfile
+ is set to -1. We must not try another repair without an open data
+ file. (Bug #25289)
+ */
+ if (file->dfile == -1)
+ {
+ sql_print_information("Retrying repair of: '%s' failed. "
+ "Please try REPAIR EXTENDED or myisamchk",
+ table->s->path);
+ DBUG_RETURN(HA_ADMIN_FAILED);
+ }
+
param.db_name= table->s->db;
param.table_name= table->alias;
param.tmpfile_createflag = O_RDWR | O_TRUNC;