diff options
author | unknown <istruewing@chilla.local> | 2007-03-16 14:26:45 +0100 |
---|---|---|
committer | unknown <istruewing@chilla.local> | 2007-03-16 14:26:45 +0100 |
commit | 13643101e0a22d686561c694561c2a11215f71e8 (patch) | |
tree | 56afd07a2fb87c423129738642f6414b07aed73b | |
parent | 39333ba7f205950ce161c051f5487be76674e39e (diff) | |
parent | 3c89dd7966e727d7ded902b195d8f133de94b565 (diff) | |
download | mariadb-git-13643101e0a22d686561c694561c2a11215f71e8.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into chilla.local:/home/mydev/mysql-4.1-bug25289
sql/ha_myisam.cc:
Auto merged
-rw-r--r-- | sql/ha_myisam.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index c6802ffe53c..39cf4782ed2 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -902,6 +902,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool 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->path); + DBUG_RETURN(HA_ADMIN_FAILED); + } + param.db_name = table->table_cache_key; param.table_name = table->table_name; param.tmpfile_createflag = O_RDWR | O_TRUNC; |